note 8920 modified in control-structures.else by vrana

From: Date: Thu, 05 Aug 2004 18:11:30 +0000
Subject: note 8920 modified in control-structures.else by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74049@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: <?php echo "You have $i ". ($i==1 ? "message" : "messages"). " in your mailbox.\n"; ?> --was-- 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://php.net/manual/en/control-structures.else.php

« previous php.notes (#74049) next »