Sure, something like the following:

$a = ( $b > 1 ) ? "b greater than 1" : "b not greater than 1";

--jess

> -----Original Message-----
> From: Ravi Malghan [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2003 12:45 PM
> To: [EMAIL PROTECTED]
> Subject: use of "?" operator instead of "if" 
> 
> 
> Hi: I have this statement which checks for existence
> of the $VAL variable and performs certain actions
> 
> if($VAL){
>   $VAL = "$VAL:$expr"; }
> else { 
>   $VAL = "$expr"; }
> 
> Can this 4 line statement be reduced to a single line
> using "?" operator?
> 
> Thanks
> Ravi
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://platinum.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to