note 42640 added to function.abs
| From: | abodemanatyahoo at rn2 dot php dot net | Date: | Mon, 24 May 2004 21:59:04 +0000 |
| Subject: | note 42640 added to function.abs | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70044@lists.php.net to get a copy of this message | ||
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
?>
----
Manual Page -- http://www.php.net/manual/en/function.abs.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42640
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42640&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42640&report=yes
Search -- http://master.php.net/manage/user-notes.php