Re: an if statement

From: Date: Tue, 23 Mar 2004 04:06:24 +0000
Subject: Re: an if statement
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-181229@lists.php.net to get a copy of this message
Andy B wrote:
was just wondering if the statement: if(!$name || !$comments){ /*whatever here*/ } would be interpreted as : if either $name or $comments doesn't exist then.... or how would the if statement be?? i need to check if the $name and $comments are empty/null because both $name and $comments are required to continue in the site (to make a post)..
although that'll generally "work", why not use if(empty($name) || empty($comments)) { dosomething(); } -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#181229) next »