(PHP 4, PHP 5, PHP 7, PHP 8)
pi —Get value of pi
Returns an approximation of pi. Also, you can use theM_PI
constant which yields identical results topi().
This function has no parameters.
The value of pi as float.
Example #1pi() example
<?php
echopi(),PHP_EOL;// 3.1415926535898
echoM_PI,PHP_EOL;// 3.1415926535898
?>