You are here: Re: reduce the following code "if ($colorVar == 'Black' || $colorVar == 'Red' || $colorVar == 'White' || $colorVar == 'Blue' ){" « PHP « IT news, forums, messages
Re: reduce the following code "if ($colorVar == 'Black' || $colorVar == 'Red' || $colorVar == 'White' || $colorVar == 'Blue' ){"

Posted by Gerhard Pfeiffer on 10/04/36 11:11

* 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация