note 102404 added to control-structures.if
| From: | DonnyNyamweya at osu1 dot php dot net | Date: | Sat, 12 Feb 2011 04:30:25 +0000 |
| Subject: | note 102404 added to control-structures.if | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176924@lists.php.net to get a copy of this message | ||
In addition to the traditional syntax for if (condition) action;
I am fond of the ternary operator that does the same thing, but with fewer words and code to type:
(condition ? action_if_true: action_if_false;)
example
(x > y? 'Passed the test' : 'Failed the test')
----
Server IP: 208.69.120.55
Probable Submitter: 108.7.177.13
----
Manual Page -- http://www.php.net/manual/en/control-structures.if.php
Edit -- https://master.php.net/note/edit/102404
Del: integrated -- https://master.php.net/note/delete/102404/integrated
Del: useless -- https://master.php.net/note/delete/102404/useless
Del: bad code -- https://master.php.net/note/delete/102404/bad+code
Del: spam -- https://master.php.net/note/delete/102404/spam
Del: non-english -- https://master.php.net/note/delete/102404/non-english
Del: in docs -- https://master.php.net/note/delete/102404/in+docs
Del: other reasons-- https://master.php.net/note/delete/102404
Reject -- https://master.php.net/note/reject/102404
Search -- https://master.php.net/manage/user-notes.php