PHP Tutorial - PHP pi() Function






Definition

The pi() function returns the value of PI.

The named constant M_PI is identical to pi().

Syntax

PHP pi() Function has the following syntax.

pi();

Parameter

None

Return

Item Description
Return Value 3.1415926535898
Return TypeFloat

Example

Return the value of PI:


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

The code above generates the following result.