note 61246 added to control-structures.switch

From: Date: Sun, 29 Jan 2006 09:28:16 +0000
Subject: note 61246 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-102660@lists.php.net to get a copy of this message
I dont 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 :) ---- Server IP: 64.246.30.37 Probable Submitter: 195.229.241.187 ---- Manual Page -- http://www.php.net/manual/en/control-structures.switch.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61246 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61246&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61246&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61246&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61246&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61246&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61246&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61246&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61246&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102660) next »