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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Lupita <lupita@xxxxxxxxxx>:
> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux