note 61246 deleted from control-structures.switch by bjori
| From: | bjori@php.net | Date: | Fri, 28 Apr 2006 14:23:10 +0000 |
| Subject: | note 61246 deleted from control-structures.switch by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-109986@lists.php.net to get a copy of this message | ||
Note Submitter: mark at softmedia4u dot com
----
I don
t know if this is any use to anyone, but i didnt see anyone mention this. If u use
dash '-' in case declaration it converts that case statement into default and ends switch.
For example this:
<?
$file = 'd';
switch($file) {
case a: echo"1"; break;
case b-a: echo"2"; break;
case c: echo"3"; break;
case d: echo"4"; break;
}
?>
prints '2'. I dont know if this is any help, but hopefully it`ll save some time :)