note 8920 added to else
| From: | cap at capsi dot com | Date: | Fri, 06 Oct 2000 02:58:21 +0000 |
| Subject: | note 8920 added to else | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6137@lists.php.net to get a copy of this message | ||
Often you can avoid large if/else statements in your code by using the trinary operator. For
example:
echo "You have $i ". ($i==1 ? "message" : "messages"). " in your
mailbox.\n";
http://www.php.net/manual/control-structures.else.php