RE: [PHP] Some questions about if and isset.
| From: | Robinson, Matthew | Date: | Mon, 31 Jan 2005 15:11:28 +0000 |
| Subject: | RE: [PHP] Some questions about if and isset. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-207766@lists.php.net to get a copy of this message | ||
Can we see some sample data? An example of what $variable and $constant
are would help.
A quick glance at the code I'd have:
if (isset($variable)
{
if ($variable < $contstant)
{
stuff
}
elseif ($variable > $constant)
{
more stuff
}
else
{
other stuff
}
}
else
{
even more stuff
}
M
-----Original Message-----
From: Geir Anders Berge [mailto:grandars@eml.cc]
Sent: 28 January 2005 19:05
To: php-general@lists.php.net
Subject: [PHP] Some questions about if and isset.
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
________________________________________________________________________
This message has been checked for all known viruses by the
CitC Virus Scanning Service powered by SkyLabs. For further information
visit
http://www.citc.it
___
________________________________________________________________________
This message has been checked for all known viruses by the
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it
___