note 11740 added to else
| From: | php-general at lists dot php dot net | Date: | Mon, 05 Mar 2001 08:02:21 +0000 |
| Subject: | note 11740 added to else | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11890@lists.php.net to get a copy of this message | ||
> echo "You have $i ". ($i==1 ? "message" : "messages"). " in
> your mailbox.\n";
I would use:
echo "You have $i message" . ($i ? "s" : "") . " in your
mailbox.\n";
At least, in most interpreted languages i've used, that would be faster/looks nicer. :)
http://www.php.net/manual/en/control-structures.else.php