Re: stupid question
| From: | Michael Sims | Date: | Thu, 15 Aug 2002 12:50:37 +0000 |
| Subject: | Re: stupid question | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112743@lists.php.net to get a copy of this message | ||
Liam MacKenzie wrote:
>>Ok, I'm having a blonde day...
>>
>>If $idx == 1, 4 or 9 I don't want it to echo $results.
>>I have this, what's the syntax to put multiple values in there?
>>
>>
>>if ($idx != "1") {
>>echo"$results";
>>}
Another way to do it is by using in_array(), like so:
if (!in_array($idx,array("1","4","9"))) {
echo "$results";
}
I don't know if that is more or less efficient to the parser, but it
looks cleaner IMHO...