English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

pi() function in PHP

Thispi()The function returns the value of Pi (π).

Syntax

pi()

Parameter

  • Not applicable

Returns

Thispi()The function returns an approximate value of PI. This value is a floating-point number.

3.1415926535898

Example

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

Output Result

3.1415926535898

Example

Let's look at another example to get the value of PI

<?php
   echo M_PI;
?>

Output Result

3.1415926535898