Re: Switch Statement || Case with multiple values?

From: Date: Mon, 03 Mar 2003 00:23:45 +0000
Subject: Re: Switch Statement || Case with multiple values?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-137820@lists.php.net to get a copy of this message
switch($value){ case 'foo': case 'bar': //It's either foo or bar break; } CF High wrote:
Hey all. In Cold Fusion I was able to do the following: <CFSWITCH expression = #action#> <CFCASE value = "getUpdate,getDelete">
       Do Stuff........
</CFCASE> </CFSWITCH> Note the comma delimited set of values for the case. Is there a way to do this in php?( i.e. if any of the comma delimited case values match the switch expression, proceed with the specified case instructions) It's kind of cumbersome breaking out 5 cases when in CF I can combine them into one........ Let me know. --Noah --
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

« previous php.general (#137820) next »