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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
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:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to