PHP abs() Function

PHP abs() Function is used to get absolute (positive) value of numbers. A abs() function is built-in function in PHP.

Syntax :

abs(int $number);

Parameter,

$number: Required. It is a number.

Return Values :

It returns positive number.

Let's see below example to understand php abs() Function in details.

Example :

<?php
echo "<br><br> Get a absolute number : ".abs(26.4);
echo "<br><br> Get a absolute number : ".abs(-77);

echo "<br><br> Get a absolute number : ".abs(-94.6);

echo "<br><br> Get a absolute number : ".abs(-35.9);
?>

Comments

Leave a Reply

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

46356