take the floor of a number in php

In PHP, you can use the floor() function to round a number down to the nearest integer. Here's an example:

main.php
$number = 3.14159;
$floor = floor($number); // $floor is now 3
63 chars
3 lines

The floor() function takes a single argument, which is the number you want to round down. It returns the rounded-down integer as a result.

related categories

gistlibby LogSnag