Function
min()
finds the lowest value from its arguments
echo min(10, 15, 7, 9, 17)."\n"; // 7
Function
max()
finds the highest value from its arguments
echo max(10, 15, 7, 9, 17)."\n"; // 17
Function
count()
counts all elements in the array
echo count([10, 15, 7, 9, 17])."\n";
Function
round()
rounds a floating-point number to its nearest integer
echo(round(0.75))."\n"; // returns 1
echo(round(0.5))."\n"; // returns 1
echo(round(0.49))."\n"; // returns 0
Function
floor()
rounds the floating-point number down
echo floor(3.3)."\n";// 3
echo floor(7.84)."\n";// 7
echo floor(-4.8)."\n";// -5
Function
ceil()
rounds the floating-point number up
echo ceil(3.3)."\n";// 4
echo ceil(7.84)."\n";// 8
echo ceil(-4.8)."\n";// -4
Function
rand()
generates a random number
echo rand()."\n";
// Generates a random number from the range
echo rand(10, 100)."\n";
Function
sqrt()
returns the square root of a number
echo sqrt(64)."\n"; // 8
Function
pow()
raises 2 to the power of 3
echo pow(2, 3)."\n"; // 8
Function
pi()
Returns PI value
echo pi()."\n";// 3.1415926535898
Function
abs()
returns the positive (absolute) value of a number
echo abs(-12)."\n";
Function
decbin()
converts decimal number into binary
echo decbin(2)."\n";// 10