Function Friday: Abs () Function
Friday July 4, 2008
The Abs () Function is used to find the absolute value of a number. The absolute value is the distance a number is from zero, so the absolute value of 6 is 6, and the absolute value of -6 is also 6. The absolute value of a number is always positive.


to get query_string on url ,for example;
http://www.mysite.com/index.php?id=-1
this id value will in is_numeric function,however,id value is negative,then abs function will usefull here.For example; query_string id value can be mysql query for id column,then that query is returned empty.
To avoke it ;
$id=(abs($_GET['id']));
if(is_numeric($id) ) {
// process…
}
else {
echo ’sorry,not is_numeric id value’;
}
you can use such as a code that above.only note that, attacker does not strive for so a situation,nevertheless,consider it :=)
regards