PHP math
17 functions
absabs(int|float $num): int|floatReturns the absolute value of number.
ceilceil(float $num): floatRound fractions up.
floorfloor(float $num): floatRound fractions down.
roundround(float $num, int $precision = 0): floatRounds a float.
maxmax(mixed $value, mixed ...$values): mixedFind highest value.
minmin(mixed $value, mixed ...$values): mixedFind lowest value.
powpow(mixed $base, mixed $exp): mixedExponential expression.
sqrtsqrt(float $num): floatSquare root.
randrand(int $min = 0, int $max = PHP_INT_MAX): intGenerate a random integer.
intvalintval(mixed $value, int $base = 10): intGet the integer value of a variable.
floatvalfloatval(mixed $value): floatGet float value of a variable.
number_formatnumber_format(float $num, int $decimals = 0, string $decimal_separator = '.', string $thousands_separator = ','): stringFormat a number with grouped thousands.
intdivintdiv(int $num1, int $num2): intInteger division.
fmodfmod(float $num1, float $num2): floatReturns the floating point remainder (modulo) of the division.
base_convertbase_convert(string $num, int $from_base, int $to_base): stringConvert a number between arbitrary bases.
decbindecbin(int $num): stringDecimal to binary.
dechexdechex(int $num): stringDecimal to hexadecimal.
