note 93639 added to control-structures.switch
| From: | Sponk at osu1 dot php dot net | Date: | Sun, 20 Sep 2009 18:38:03 +0000 |
| Subject: | note 93639 added to control-structures.switch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160869@lists.php.net to get a copy of this message | ||
Since the code in the previous posting was not working as expected, I decided on posting a tiny
correction to that code that worked just fine for me (in particular, note the difference in the
"switch"-line):
<?php
switch (TRUE) {
case ($totaltime < 1):
echo "That was fast!";
break;
case ($totaltime >= 1 && $totaltime < 10):
echo "Not fast!";
break;
case ($totaltime >= 10):
echo "That's slooooow";
break;
}
?>
----
Server IP: 212.124.37.9
Probable Submitter: 93.222.227.188
----
Manual Page -- http://www.php.net/manual/en/control-structures.switch.php
Edit -- https://master.php.net/note/edit/93639
Del: integrated -- https://master.php.net/note/delete/93639/integrated
Del: useless -- https://master.php.net/note/delete/93639/useless
Del: bad code -- https://master.php.net/note/delete/93639/bad+code
Del: spam -- https://master.php.net/note/delete/93639/spam
Del: non-english -- https://master.php.net/note/delete/93639/non-english
Del: in docs -- https://master.php.net/note/delete/93639/in+docs
Del: other reasons-- https://master.php.net/note/delete/93639
Reject -- https://master.php.net/note/reject/93639
Search -- https://master.php.net/manage/user-notes.php