Re: if syntax using multiple conditions

From: Date: Mon, 13 Sep 2004 17:50:57 +0000
Subject: Re: if syntax using multiple conditions
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-196538@lists.php.net to get a copy of this message
Brian Anderson wrote:
What is the proper syndax in an if statement for containing multiple conditions? example: if ( condition1 && condition2 ) {
    dothis;
} if ( condition1 && (condition2 || condition3) ) {
    dothis;
}
Both are valid. First example will validate if both condition1 and condition2 evaluate to true (they're set, and not null or false, etc.). Second example will validate if condition1 evaluates to true AND EITHER condition2 OR condition3 evaluate to true -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#196538) next »