English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Theabs()
The function returns the absolute value of the number.
abs(num)
num-We want to get the absolute value of the number. If num is a float, the return type is float, otherwise it is an integer.
Theabs()
The function returns the absolute value of the specified number.
<?php echo(abs(3.1) . "<br>"); echo(abs(-9.7) . "<br>"); ?>
Output Result
3.1<br>9.7<br>
Let's see another example-
<?php echo(abs(20) . "<br>"); echo(abs(-50) . "<br>"); ?>
Output Result
20<br>50<br>