NYCPHP Meetup

NYPHP.org

[nycphp-talk] TRUE/FALSE and $_SESSION variables

Chris Shiflett shiflett at php.net
Wed Jul 11 23:22:56 EDT 2007


Try this example. (It works for me.)

<?php

session_start();

if (!isset($_SESSION['foo'])) {
    $_SESSION['foo'] = TRUE;
}

if ($_SESSION['foo'] === TRUE) {
    echo '<p>TRUE</p>';
} else {
    echo '<p>Not TRUE</p>';
}

print_r($_SESSION);

?>

Chris

Michael Southwell wrote:
> $_SESSION['ineligibleFlag'] = TRUE;
> if ( $_SESSION['ineligibleFlag'] === TRUE ) echo 'not';
> 
> 'not' is not echoed. Why not?

-- 
Chris Shiflett
http://shiflett.org/



More information about the talk mailing list