Re: String to Boolean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You do not need a specific function.


http://www.php.net/manual/en/language.types.boolean.php

the empty string, and the string  "0" is consider
false.
any other value is true.


eg.
$strText = "something";
$blnText = (boolean) $strText;
// it will be true

$strText = "";
$blnText = (boolean) $strText;
// it will be false



--- sylvano3 <sylvano3@xxxxxxxxx> wrote:

> Hi,
> im lookin for a php-function that tranform a string
> to a boolean
> 
> ie:  strtoboolean(string s) return TRUE or FALSE
> 
> 
> 
> 
> 
> 



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux