If you want to find out the square root of a number then use sqrt() function.
PHP sqrt() Function Example:
If you want to find out the square root of a number then use sqrt() function. This function return square root of a number. The sqrt() function will return NAN if the number is a negative.
Syntax:
sqrt(number)
Example:
<?php echo(sqrt(0) . "<br />"); echo(sqrt(9) . "<br />"); echo(sqrt(0.64) . "<br />"); echo(sqrt(-9)) ?>
Output:
The output of this example is:
0 3 0.8 NAN
[ 0 ] Comments