Articles → PHP → abs function in php

abs function in php






Purpose





Example


<!DOCTYPE html>
<html>

<body>
<?php
echo("Absolute value of -3 is: " . abs(-3) . "<br>");
echo("Absolute value of 3 is: ". abs(3));
?>
</body>

</html>



Output


Picture showing the output of abs function in php

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Friday, September 25, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250