PHP.nl

pi

pi

Get value of pi

float **pi**

Returns an approximation of pi. Also, you can use the constant which yields identical results to . M_PI``pi

The value of pi as float.

Voorbeeld: example

<?php
echo pi(), PHP_EOL; // 3.1415926535898
echo M_PI, PHP_EOL; // 3.1415926535898
?>