Switch Question
| From: | Van Andel, Robbert | Date: | Mon, 24 Feb 2003 22:48:46 +0000 |
| Subject: | Switch Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-137005@lists.php.net to get a copy of this message | ||
I'm trying to make a switch statement that looks for more than one possible value. Something
similar to:
switch($color)
{
case "black" || "1":
return ImageColorAllocate($image,0,0,0);
break;
case "white" || "2":
return ImageColorAllocate($image,255,255,255);
break;
case "gray" || "3":
return ImageColorAllocate($image,200,200,200);
break;
}
This is not working however, since all my colors are now black (it worked before I add the number
portion of the case statement.
First off, is this even possible to do, or do I need to make a seperate case for the numbers. If it
is possible, how do I make it work?
Robbert van Andel