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