note 31792 deleted from control-structures by didou
| From: | didou@php.net | Date: | Sun, 03 Aug 2003 10:01:07 +0000 |
| Subject: | note 31792 deleted from control-structures by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53239@lists.php.net to get a copy of this message | ||
Note Submitter: Storm
----
Although the alternate syntax is nice, I myself prefer to use a simple function:
function iif ($statement,$true_return,$false_return) {
if ($statement == false) {
return $false_return;
} else {
return $true_return;
}
}
Works great for me...
$one = iif (isset($one),$one,'one');
$two = iif (isset($two),$two,'two');
$three = iif (isset($three),$three,'three');
:D