PHP Math

PHP has a set of math functions that allows you to perform mathematical tasks on numbers.

PHP pi() Function

The pi() function returns the value of PI:

3.1415926535898

PHP min() and max() Functions

The min() and max() functions can be used to find the lowest or highest value in a list of arguments:

-200150

PHP abs() Function

The abs() function returns the absolute (positive) value of a number:

6.7

PHP sqrt() Function

The sqrt() function returns the square root of a number:

8

PHP round() Function

The round() function rounds a floating-point number to its nearest integer:

10

Random Numbers

The rand() function generates a random number:

756555210