RE: [PHP] Send_mail function

From: Date: Fri, 11 Aug 2000 17:43:20 +0000
Subject: RE: [PHP] Send_mail function
Groups: php.general 
Request: Send a blank email to php-general+get-11366@lists.php.net to get a copy of this message
Actually, unless PHP is different from every other language I know, it should be: elseif ($chr == "B" || $chr == "C" || $chr == "D") { send_to_you(); } The statement below would compute the binary value (true/false) of $chr == "B", then or that with "C", then or the result of that with "D". Because "C" and "D" are both considered true, and the or operator always returns true when one of its operands is true, the statement below will also always be considered true, and the elseif clause will always be executed. But I agree with Robin: use a switch statement instead. --Bruce Bruce Christensen Intel Corporation brucex.r.christensen@intel.com -----Original Message----- From: Ben Gollmer [mailto:ben@jatosoft.com] Sent: Friday, August 11, 2000 9:14 AM To: David Tandberg-Johansen Cc: PHP Discussion Subject: Re: [PHP] Send_mail function I believe your elseif statement should read elseif ($chr == "B" || "C" || "D") { send_to_you(); } Ben

« previous php.general (#11366) next »