note 65742 added to control-structures.alternative-syntax
| From: | php-general at lists dot php dot net | Date: | Sun, 07 May 2006 15:51:23 +0000 |
| Subject: | note 65742 added to control-structures.alternative-syntax | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-110739@lists.php.net to get a copy of this message | ||
Also another tidy way to do conditional testing:
(Just remember to have as many right-parenthesis as many as you have conditions)
<?php
$grade = (($a < 70) ? 'Fail' :
(($a < 80) ? 'Satisfactory' :
(($a < 90) ? 'Good' :
(($a < 100) ? 'Very good' :
(($a == 100) ? 'Excellent' :
'N/A')))));
echo $grad;
?>
----
Server IP: 66.163.161.117
Probable Submitter: 210.4.22.199 (proxied: 192.168.1.37)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/control-structures.alternative-syntax.php
Edit -- http://master.php.net/note/edit/65742
Del: integrated -- http://master.php.net/note/delete/65742/integrated
Del: useless -- http://master.php.net/note/delete/65742/useless
Del: bad code -- http://master.php.net/note/delete/65742/bad+code
Del: spam -- http://master.php.net/note/delete/65742/spam
Del: non-english -- http://master.php.net/note/delete/65742/non-english
Del: in docs -- http://master.php.net/note/delete/65742/in+docs
Del: other reasons-- http://master.php.net/note/delete/65742
Reject -- http://master.php.net/note/reject/65742
Search -- http://master.php.net/manage/user-notes.php