Re: B R A I N F R E E Z E !

From: Date: Thu, 23 May 2002 00:31:25 +0000
Subject: Re: B R A I N F R E E Z E !
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-98843@lists.php.net to get a copy of this message
On Wed, 22 May 2002, Shane wrote: > Too Many HOURS!!! > Too Little M&Ms!! > Forgot... Brain... Ouch! > > Someone please remind me, what the hell the syntax for the short hand of the PHP "IF > THEN" statement is where multiple variables need to be checked > > if($foo == "Panda" and $bar == "bear){ > doWhatever(); > } > > Thanks gang! > - Shane If I understood you correctly, there is a short hand syntax for "IF THEN ELSE" (not just "IF THEN") which is like: (expression)?(then_expression):(else_expression) Of course if you only have a THEN part its easy to do: ($foo=="Panda" && $bar=="bear")?(doWhatever();):true; cheers, thalis

« previous php.general (#98843) next »