Re: How to test if a number is negative

From: Date: Thu, 26 Sep 2002 02:07:35 +0000
Subject: Re: How to test if a number is negative
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-117660@lists.php.net to get a copy of this message
$x = -1; if ($x < 0 ){
        echo "Negative";
else
        echo "Positive";
} Or am I missing something? Miles At 07:02 PM 9/25/2002 -0700, Mike Dunlop wrote:
I've look through all the numerican functions but can't readily see a way to test for a negative number e.g -7 Any ideas on how to do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#117660) next »