[nycphp-talk] Casting string "false" to boolean
Jakob Buchgraber
jakob.buchgraber at googlemail.com
Thu May 3 11:41:11 EDT 2007
Rob Marscher wrote:
>> 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
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>
Nice. Thanks! :)
Cheers,
Jay
More information about the talk
mailing list