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

Posted by Lupita on 10/02/90 11:11

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

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