shorthand "if" notation
| From: | adrian GREEMAN | Date: | Wed, 11 Jun 2003 14:23:21 +0000 |
| Subject: | shorthand "if" notation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151071@lists.php.net to get a copy of this message | ||
I am confused by the shorthand "if" notation.
For example I just saw this PHP snippet on another forum
<?
$bkgndClass = $bkgndClass == "darkBkgnd" ? "liteBkgnd" :
"darkBkgnd";
}
?>
I think it is an if but cannot find it in the manual. How
is that written in the more normal notation - if(){} etc??
[And please excuse a slightly off-thread but related extension to
the question but I have seen similar in Javascript - namely ---
var evt = (evt ? evt : ((window.event) ? window.event : null);
is this the same notation or something else?]
Regards Adrian Greeman