hi , i've try to make this function to perform GAtter function STRTOBOOL($string){ if (!empty($string)){ $element =explode(' ',$string); $GATTER =$element[1]; $ODER_GATTER='||'; $AND_GATTER='&&'; switch($GATTER){ case $ODER_GATTER: if(in_array('TRUE',$element)) return 1; else return 0; break; case $UND_GATTER: if(in_array('FALSE',$element)) return 0; else return 0; break; } } } --- Vixel Technologies <raees@xxxxxxxxx> schrieb: > Hi Sylvano > > Well Brian is right i am also not able to figure out > your exact requirement > why do you want so. If you can share something maybe > we can help you out in > this. > > Also if you are trying to validate form elements > with that you can directly > pass 1 for true and 0 for false as value of that > element. > > > Raees > ----- Original Message ----- > From: "Brian Etheridge" > <Brian.Etheridge@xxxxxxxxxxx> > To: <php-objects@xxxxxxxxxxxxxxx> > Sent: Thursday, October 27, 2005 1:03 PM > Subject: RE: Re: String to Boolean > > > > Hi Sylvano, > > I think you will get very little response to your > query because the nature > > of what you are trying to do is completely wrong. > Back up a bit and > > describe why you think you need to parse a string > to determine true or > > false. > > > > All I can think of is that you are posting a form > with various selection > > criteria obtained from several listboxes set to > TRUE or FALSE. There must > > be a better way of handling the user interface, or > these responses, rather > > than parsing them as strings. > > > > Give us a bit more information. > > > > Brian > > > > -----Original Message----- > > From: Jean-Sylvain Ndjeukoua > [mailto:sylvano3@xxxxxxxxx] > > Sent: 27 October 2005 05:15 > > To: php-objects@xxxxxxxxxxxxxxx > > Subject: Ant: Re: String to Boolean > > > > > > hi DF Yeah > > > > i want a function to solve this kind of operation > > > > boolean function (string "TRUE && FLASE") > > > > We kann have all Gatter &&,||,.... > > > > for exemple this function ("TRUE && FLASE") return > FALSE > > > > > > > > > > hi > > --- DF Yeah <df_yeah@xxxxxxxxx> schrieb: > > > > > 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 > > > > > > > > > > > > > > > > > > > > ___________________________________________________________ > > Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher > kostenlos - Hier > anmelden: > > http://mail.yahoo.de > > > > > > > > > > > > PHP Data object relational mapping generator - > http://www.meta-language.net/ > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > PHP Data object relational mapping generator - > http://www.meta-language.net/ > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de ------------------------ 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/