NYCPHP Meetup

NYPHP.org

[nycphp-talk] Casting string "false" to boolean

Rob Marscher rmarscher at beaffinitive.com
Mon Apr 30 13:45:11 EDT 2007


>  If you're getting input for a false value as "false" you should  
> really use some kind of conditional statement.

Yeah... like this:

$string = 'false';
$bool = ($string != 'false');
var_dump($bool);


-Rob




More information about the talk mailing list