|
|
PHP abs() - Math Functions
|
Tutorials » Php »
|
Topic |
What is abs Function?
|
|
Explanation |
|
The "abs()" math function returns the absolute value of the number.
Syntax:
abs(x)
In the above syntax "x" is a number that is float which returns a float,or an integer value.
Example:
<?php
echo(abs(-6.2));
print "<br>";
echo(abs(7));
print "<br>";
echo(abs(-3));
?>
Result:
6.2
7
3
In the above example the absolute value of the negative numbers are displayed.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|