What does php code abs mean?
Definition and usage of abs function in php
abs() function returns the absolute value of a number.
Syntax
abs(x)
Parameters
x Required. A number.
Description
Returns the absolute value of parameter x. If the parameter x is a float, the return type is also a float, otherwise an integer is returned (because float usually has a larger value range than an integer).
Example
<?php echo(abs(6.7)); echo(abs(-3)); echo(abs(3)); ?>
Output:
6.7 3 3
For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of What does abs in php code mean?. For more information, please follow other related articles on the PHP Chinese website!