Introduction
In this article I will explain Ceil() and Floor() functions in PHP. The ceil() and floor() functions are math functions. First of all I will discuss the ceil() function used to get the next highest integer value by rounding fractions up. The ceil() function is basically used for pagination.
Syntax
|
float Ceil($num_value); |
| Name | Description |
| num_value | The value to round |
This function returns the value rounded up to the next highest integer value. It returns a rounded value of float.
Example
<?php
$a=ceil(9.4);
$b=ceil(29.449);
$c=ceil(-8.4);
$d=ceil(801.9);
$e=ceil(1200.94);
echo "The Ceil value of 9.4 is ". $a . "<br />" ;
echo "The Ceil value of 29.449 is ". $b . "<br />" ;
echo "The Ceil value of -8.4 is ". $c . "<br />" ;
echo "The Ceil value of 801.9 is ". $d . "<br />" ;



Join the conversation! Your thoughts help the community grow.