Ravi Malghan wrote:
> 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? 

$VAL = $VAL ? "$VAL:$expr" : $expr;

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

Reply via email to