note 54116 deleted from control-structures.switch by jome
| From: | jome@php.net | Date: | Tue, 18 Oct 2005 19:34:45 +0000 |
| Subject: | note 54116 deleted from control-structures.switch by jome | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97191@lists.php.net to get a copy of this message | ||
Note Submitter: Bob
----
// The code posted on 10-Jun-2005 01:40 has an error
// The switch condition should test against TRUE not $month_name
$month_name = 'Jan';
switch ( TRUE) {
case ($month_name === "Jan" || $month_name === "January"):
$month_num = "1";
break;
default:
$month_num = "???";
break;
}
echo $month_num;