note 40367 added to function.abs
| From: | mbender at duforu dot com | Date: | Mon, 01 Mar 2004 18:59:55 +0000 |
| Subject: | note 40367 added to function.abs | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66056@lists.php.net to get a copy of this message | ||
In reference to the previous code sample the int_val function is actually intval()
[http://us4.php.net/manual/en/function.intval.php]:
<?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(!int($range))//checks to make sure it is an integer (not decimal)
{
$range=intval($range) // not -> 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+40367
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40367&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40367&report=yes
Search -- http://master.php.net/manage/user-notes.php