reduce the following code "if ($colorVar == 'Black' || $colorVar == 'Red' || $colorVar == 'White' || $colorVar == 'Blue' ){"

From: Date: Wed, 23 Mar 2005 08:54:50 +0000
Subject: reduce the following code "if ($colorVar == 'Black' || $colorVar == 'Red' || $colorVar == 'White' || $colorVar == 'Blue' ){"
Groups: php.general 
Request: Send a blank email to php-general+get-211368@lists.php.net to get a copy of this message
Hello; Can any one show me a way to reduce the following code? ###################################################### <?php if ($colorVar == 'Black' || $colorVar == 'Red' || $colorVar == 'White' || $colorVar == 'Blue' ){ $someVar = "Something"; } ?> ######################################################## I was thinking there must be a way to place all the Colors into a $allColorVar and check to see if $colorVar = $allColorVar?

« previous php.general (#211368) next »