PHP floor() & ceil()
floor() function returns the closest smaller integer. If the argument is an integer, then return the integer.
<?PHP
echo floor(3.2); //3
echo floor(-3.4); //-4
echo floor(3); //3
echo floor(-4); //-4
?>
ceil() function returns the closest larger integer. If the argument is an integer, then return the integer.
<?PHP
echo ceil(3.2); //4
echo ceil(-3.4); //-3
echo ceil(3); //3
echo ceil(-4); //-4
?>