PHP sqrt() function with example

 16 - Mar - 2022
 XpertPhp
 67

In this article, We will explain to you PHP sqrt() function with example.

PHP sqrt() function

The sqrt() function is a built-in function of PHP. which is used to return the square root of a number. so you can see our PHP math Function example.

Syntax

sqrt(number);

Example

<?PHP
echo sqrt(9);
echo "
";
echo sqrt(25);
echo "
"; 
echo sqrt(0);
?>

Output

3
5
0

Reference: PHP sqrt() function