note 40523 added to language.operators
| From: | j dot gizmo at aon dot at | Date: | Sat, 06 Mar 2004 12:06:47 +0000 |
| Subject: | note 40523 added to language.operators | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66341@lists.php.net to get a copy of this message | ||
this ternary operator is more or less a shortform of an if/else statement.
you can also use it on its own.
($condition=='good') ? (print('we have good conditions.')) : (print('we
have bad conditions.'));
----
Manual Page -- http://www.php.net/manual/en/language.operators.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40523
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40523&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40523&report=yes
Search -- http://master.php.net/manage/user-notes.php