How to use abs in PHP

This article describe about abs() Function in PHP.
  • 1250

abs() Function

This function return the absolute value of number.

Syntax

abs(a)

 

Parameter Description
a Required. If number is type float return also float otherwise interger.

Example

<html>
<body>
<?php
echo(abs(7.6) . "<br />");
echo(abs(-5) . "<br />");
echo(abs(5));
?>
</body>
</html>

 

Output


absphp.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.