floor
Description
Syntax
floor ( float $value ) : float
Parameters
value
The numeric value to round
Return
value rounded to the next lowest integer. The return value of floor() is still of type float because the value range of float is usually bigger than that of integer. This function returns FALSE in case of an error (e.g. passing an array).
Examples
1
<? $value = -99.9999; $return = floor($value); echo $return; ?>
-100
2
<? $value = -99.0001; $return = floor($value); echo $return; ?>
-100
3
<? $value = 99.0001; $return = floor($value); echo $return; ?>
99
4
<? $value = 99.9999; $return = floor($value); echo $return; ?>
99