PHP pi() Function
In this chapter you will learn:
- Definition for PHP pi() Function
- Syntax for PHP pi() Function
- Parameter for PHP pi() Function
- Return for PHP pi() Function
- Example - Get the value of PI
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 Type | Float |
Example
Return the value of PI:
<?php
echo(pi());
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP pow() Function
- Syntax for PHP pow() Function
- Parameter for PHP pow() Function
- Return for PHP pow() Function
- Example - Raise to the power
Home » PHP Tutorial » PHP Math Functions