RE: [PHP] Re: Quick conditional question
| From: | James Taylor | Date: | Sat, 10 May 2003 07:27:15 +0000 |
| Subject: | RE: [PHP] Re: Quick conditional question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147101@lists.php.net to get a copy of this message | ||
Yeah, I ended up going with if(in_array($row,array(1,9,13,20)).
Thanks for the idea guys
-----Original Message-----
From: Guillaume [mailto:g.jullien@free.fr]
Sent: Friday, May 09, 2003 11:39 PM
To: php-general@lists.php.net
Subject: [PHP] Re: Quick conditional question
You can try this
$array = array(1, 9, 13, 20);
if (in_array($row, $array)) blah
Guillaume
James Taylor a écrit:
> How can I shorten this syntax:
>
> If($row==1||$row==9||$row==13||$row==20) blah
>
> Looking for something like
>
> If($row==(1||9||13||20))
>
> But, that doesn't work. Thanks
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php