note 34049 deleted from control-structures by didou
| From: | didou@php.net | Date: | Mon, 04 Aug 2003 06:02:23 +0000 |
| Subject: | note 34049 deleted from control-structures by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53297@lists.php.net to get a copy of this message | ||
Note Submitter: rickardsjoquist@hotmail.com
----
There is an (undocumented? I couldn't find it) way to write simple control structures at one
line (exactly the same as in javascript):
$a = 1;
$b = ($a==1) ? "a is 1" : "a is not 1";
echo $b;
this could also be used this way:
$a = ($a==1) ? true : false;
simple and efficient and easier to read than the regular syntax.