ceil

int ceil(float number) 

Returns an integer that is the next larger than the float given as the argument.

Returns:

Integer on success; FALSE on error

Description:

Returns an integer that is the next larger than the float used as the argument. In essence, it rounds up a floating-point number to an integer, no matter what the value of the floating-point integer is. It doesn’t round down.

Version:

PHP 3, PHP 4

See also:

floor() 
round() 

Example:

Round up a floating-point number
$number = 12.023; 
echo "The next highest integer of $number is ", ceil($number); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.