Some questions about if and isset.

From: Date: Fri, 28 Jan 2005 19:05:17 +0000
Subject: Some questions about if and isset.
Groups: php.general 
Request: Send a blank email to php-general+get-207764@lists.php.net to get a copy of this message
I'm sure that this code can be written more efficient, please tell me how, but that's not my problem. The problem is that when i run this script all lines are executed. I'm sure I'm doing something wrong, but can't find out just what. <?php if (isset($variable)) { if ($variable < $constant) { Execute this code if $variable is less than $constant } if ($variable > $constant) { Execute this code if $variable is more than $constant } if ($variable == $constant) { Execute this code if $variable and $constant are equal } } else { Execute this code if $variable is not set } ?> Thanks for all help! Geir Anders Berge

« previous php.general (#207764) next »