How about something like this:
if ($_SESSION["temp"] > 0) ? Or if you want to be really sure: if ($_SESSION["temp"] > 0 && $_SESSION["temp"] != "") OR....if you want to be sure the value is a number as well: if ($_SESSION["temp"] > 0 && $_SESSION["temp"] != "" && is_numeric($_SESSION["temp"]) HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 x289 [EMAIL PROTECTED] -----Original Message----- From: Francis [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:23 AM To: [EMAIL PROTECTED] Subject: [PHP] Argh! nulls un stuff.. ok going mad all I need to do is check a variable and if it has a number in it then do something, so anything from 0 up, but it keeps thinking 0 is null and failing, anyway around this? or am I just being stupid as usual? $_SESSION["temp"] = 0; $tempVar = 0; if($_SESSION["temp"] !=""){ echo "!= condition<br>"; } if(isset($_SESSION["temp"])){ echo "isset condition<br>";} if(isset($tempVar)){ echo "tempVar isset condition<br>";} if($tempVar !=""){ echo "tempVar != condition<br>";} if(!empty($tempVar)){ echo "tempVar !empty condition<br>";} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php