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?




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



Reply via email to