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