Re: Help with silly silly problem....

From: Date: Fri, 05 Jan 2001 19:57:50 +0000
Subject: Re: Help with silly silly problem....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-32927@lists.php.net to get a copy of this message
> > if (($form_var_1) && ($form_val_2) && ($form_val_3)) { > echo "You set them all"; > } if ($anything) tests to see if it is a non-zero number, as in C. I think what you want to do is see if anything is in these variables -- like a string, or a number or something. This is what I do: if (strlen($form1) && strlen($form2) && strlen($form3)) // then do something I use strlen because it doesn't complain when a veriable is not set, and simply returns 0, otherwise, if it is set and it is a string, it returns grater than zero (or TRUE) and if what I pass in is a number, then the PHP auto type conversion kicks in, changes it to a string, and then also returns greater than zero (or TRUE). Hope this helps. Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com

« previous php.general (#32927) next »