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 Lupita on 03/23/05 20:41

Thank You that did it.
"Lupita" <lupita@lanset.com> wrote in message
news:20050323085439.32609.qmail@lists.php.net...
> 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?

 

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

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