RE: [PHP] Like ternary but without the else.
| From: | rich | Date: | Fri, 25 Feb 2005 23:46:36 +0000 |
| Subject: | RE: [PHP] Like ternary but without the else. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-209469@lists.php.net to get a copy of this message | ||
I couldn't find this anywhere on google or PHP's site but I'm pretty sure
there's an answer to it.
How can I turn the following into something that resembles the ternary
operator?
<?php
if($something)
{
$this = $that;
}
?>
is this what you're after?
$this = ($something ? $that : $this)
rich