note 42640 deleted from function.abs by hholzgra

From: Date: Sun, 15 Apr 2012 19:26:26 +0000
Subject: note 42640 deleted from function.abs by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-187141@lists.php.net to get a copy of this message
Note Submitter: abodeman at y a h o o ---- There's another problem in the below code. The correct function to see whether a value is an integer is is_int(), not int(), so the code should look like this: <?php if(!is_numeric($range))//checks for numeric input { $range=1; }//sets $range to integer 1 if input is anything other than a numeric value if(!is_int($range))//checks to make sure it is an integer (not decimal) { $range=int_val($range); }//if a decimal- sets $range to integer value $range=abs($range);//sets value to positive whole number ?>

« previous php.notes (#187141) next »