PHP abs() function
Complete PHP Math Reference
Definition and Usage
The abs() function returns the absolute value of a number.
Syntax
Parameter |
Description |
x |
Required. A number. If the number is of type float, the
return type is also float, otherwise it is integer |
Example
<?php
echo(abs(6.7) . "<br />");
echo(abs(-3) . "<br />");
echo(abs(3));
?>
|
The output of the code above will be:
Complete PHP Math Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|