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.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions