note 21520 added to control-structures.switch

From: Date: Wed, 15 May 2002 23:44:43 +0000
Subject: note 21520 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-30690@lists.php.net to get a copy of this message
In case : ) it helps someone, I was able to clean up some hairball code by using nested switches (didn't see it mentioned here). Thanks to all those who are writing examples - I love this site! $string_match="second"; switch ($string_match) { case "first": case "second": case "third": print "<H3>Something for all three</H3><br>"; switch ($string_match) { case "first": print "something for first only"; break; case "second": case "third": print "something for the other two"; break; } break; default: print "<H3>no match</H3>"; } -- http://www.php.net/manual/en/control-structures.switch.php http://master.php.net/manage/user-notes.php?action=edit+21520 http://master.php.net/manage/user-notes.php?action=delete+21520 http://master.php.net/manage/user-notes.php?action=reject+21520

« previous php.notes (#30690) next »