How come

if (isset($_SESSION['location']) AND !empty($_SESSION['location']))

work while

if (isset($_SESSION['location']) && !empty($_SESSION['location']))


I am using eval() to process PHP inside a wordpress page. It can make no sense in my experience why PHP chokes on && and never AND. The paperwork don't say anything particularly and nobody else appears to possess a obvious answer.

Interesting input.


Not too it truly matters, however i use eval() inside a Wordpress template:

            $sContent   = get_the_content();
            $sContent   = apply_filters('the_content', $sContent);
            $sContent   = str_replace(']]>', ']]>', $sContent);

            eval(' ?>'. $sContent .'<?php ');

Wordpress converts the && to &#038;&.

I have encounter an problem such as this before, therefore it is good to understand. I actually do the majority of the logic for the reason that PHP Wordpress template, making this no large deal, jsut as lengthy when i understand what's happening.

Thanks visit GigaWatt for pointing this out and telling me of most loved reminiscences.