Home >Backend Development >PHP Tutorial >What does php floor function mean?
In PHP, the floor() function means "round down", or "round down" or "round toward zero", which is used to round down to the nearest integer. , the syntax is "floor(number)"; it can return the largest integer not larger than the parameter number. If there is a decimal part, it will be rounded directly.
What does the floor function mean?
floor function, its function is to "round down", or When it comes to "rounding down" or "rounding toward zero", that is, taking the largest integer that is no greater than The largest integer value of the value.
Floor function: round down to the nearest integer.
Syntax:
floor(number)
Parameters:
number, required, a number.
Description: Return the next integer that is not greater than the parameter number. If there is a decimal part, it will be rounded off directly.
php floor() function example
<?php $i = 66.7; $i = floor($i); $j = -66.7; $j = floor($j); echo $i."*****".$j ?>
Output:
66*****-67
The above is the detailed content of What does php floor function mean?. For more information, please follow other related articles on the PHP Chinese website!