Can’t combine strpos and !empty in PHP, why?

I have two lines in PHP that if I combine causes my page to stop loading…Unfortunately, I have no error message using error_reporting(E_ALL | E_STRICT); ini_set('display_errors', true);, and nothing in my apache error.log file.

this works:

$user_setup = strpos($_SESSION['user'], "@");
if (!empty($user_setup)) {....

But, this does not:

if (!empty(strpos($_SESSION['user'], "@"))) {....

Is there something about the strpos function causing this to not work?

Thanks for your help!

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories