Articles → PHP → Abs Function In PHPAbs Function In PHPIn this article, we will discuss the abs() function in PHP.Purpose In PHP, the abs() function returns the absolute value (actual magnitude) of the number. For example, the absolute value of -4 and 4 is 4.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 Click to EnlargePosted By - Karan Gupta Posted On - Friday, September 25, 2020 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
<!DOCTYPE html> <html> <body> <?php echo("Absolute value of -3 is: " . abs(-3) . " <br>"); echo("Absolute value of 3 is: ". abs(3)); ?> </body></html>
Query/Feedback