Re: If 1 IF fails, do the rest anyway...
| From: | Jason k Larson | Date: | Thu, 13 Mar 2003 21:26:23 +0000 |
| Subject: | Re: If 1 IF fails, do the rest anyway... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139603@lists.php.net to get a copy of this message | ||
That's exactly what logical operators are for.
http://www.php.net/manual/en/language.operators.logical.php
use || instead of && for allowing either to be true.
if ((test1) || (test2) || (test3))
{
\\ if any of these can return true, this will execute
}
HTH,
Jason k Larson
Liam Gibbs wrote:
I know that in a case like this if((test1) && (test2) && (test3)) {...} if test1 fails, dear PHP won't bother doing test2 and 3. Am I correct? Is there a syntax that will make it carry on with test2 and 3 anyway, regardless of how test1 came out?