Reply to Re: If Or

Your name:

Reply:


Posted by Geoff Berrow on 04/18/07 13:13

Message-ID: <1176901125.935895.207100@b58g2000hsg.googlegroups.com> from
GarryJones contained the following:

>A long winded way to do it and the only way I know how to use OR is...
>
>if ($var == 1 || $var == 3 || $var == 7 || $var == 7 || $var == 9 ||
>$var == "Table" || $var == "Chair")
>...etc
>
>But I would like to just list the values (and not the $var == for
>every possible condition

Put the values in an array and use in_array()

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

[Back to original 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

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