floor

int floor(float i) 

Truncates the given argument to the integer portion.

Returns:

Next-lowest integer from the given argument; FALSE on error

Description:

floor() is the opposite of ceil(). It rounds down a floating-point number to the next-lowest integer, no matter what the value of the floating-point number is.

Version:

PHP 3, PHP 4

See also:

ceil() 
round() 

Example:

Truncate a floating-point number
$number = 12.923; 
echo "The next smaller integer to $number is ", floor($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.