RE: [PHP] if statement
| From: | Martin Towell | Date: | Tue, 09 Jul 2002 04:01:44 +0000 |
| Subject: | RE: [PHP] if statement | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-106221@lists.php.net to get a copy of this message | ||
You can do this:
if ($type == "test1" || $type == "test2" || $type == "test3") {
or, what I prefer in this case
if (in_array($type, array("test1", "test2", "test3"))) {
Martin
-----Original Message-----
From: rdkurth@starband.net [mailto:rdkurth@starband.net]
Sent: Tuesday, July 09, 2002 2:11 PM
To: php-general
Subject: [PHP] if statement
Is it possible to do something like this all on one line.
What I need is if any one of these are true then run the script
if($type=="test1")or($type=="test2")or($type=="test3"){
--
Best regards,
rdkurth mailto:rdkurth@starband.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php