Re: reduce the following code "if ($colorVar == 'Black' || $colorVar == 'Red' || $colorVar == 'White' || $colorVar == 'Blue' ){"
| From: | Gerhard Pfeiffer | Date: | Wed, 23 Mar 2005 09:17:16 +0000 |
| Subject: | Re: reduce the following code "if ($colorVar == 'Black' || $colorVar == 'Red' || $colorVar == 'White' || $colorVar == 'Blue' ){" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-211370@lists.php.net to get a copy of this message | ||
* Lupita <lupita@lanset.com>:
> Can any one show me a way to reduce the following code?
> [...]
> I was thinking there must be a way to place all the Colors into a
> $allColorVar and check to see if $colorVar = $allColorVar?
I think http://de3.php.net/manual/en/function.in-array.php
is what you
want :)
Ciao,
Gerhard