Latest web development tutorials

PHP pi () function

PHP Math Reference PHP Math Reference

Examples

Returns the value of pi PI:

<?php
echo(pi());
?>

Running instance »

Definition and Usage

pi () function returns the value of pi PI.

Tip: M_PI and named constant pi () produces the same result.


grammar

pi();

technical details

return value: 3.1415926535898
Return type: Float
PHP version: 4+


PHP Math Reference PHP Math Reference