PHP abs() Function

Last Updated on May 21, 2021 by Roshan Parihar

PHP abs() Function returns the absolute value of the given number. The absolute value means it always be positive whether the number is integer or float.

Syntax of PHP abs() Function

abs(number)

Description of Parameters

Name Description
number Required. It is a numeric value that can be an integer or float type number to find the absolute value.

Examples on PHP abs() Function

Output

17
24
5
9

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.