The ceil() function rounds a number to the nearest integer. The value is rounded up to the nearest greatest integer.
Syntax
ceil(num)
Parameters
num − The number to round up
Return
The ceil() function Returns the value rounded up to the nearest (up) integer.
Example
<?php echo(ceil(0.90) . "<br>"); echo(ceil(0.15) . "<br>"); ?>
Output
1<br>1<br>
Example
Let us see another example −
<?php echo(ceil(2)); ?>
Output
2
Example
Let us see another example −
<?php echo(ceil(8.9) . "<br>"); echo(ceil(-9.2) . "<br>") ?>
Output
9<br>-9<br>