Get the absolute value of different numbers in PHP

Description

The following code shows how to get the absolute value of different numbers.

Example


/*from w ww .  j  a v a  2 s .c o m*/
<?php
    echo(abs(6.7) . "<br>");
    echo(abs(-6.7) . "<br>");
    echo(abs(-3) . "<br>");
    echo(abs(3));
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Development »




Environment
Error
Hash
Include
Locale
Math
Network
Output
Reflection
PHP Regular Expressions