Round value float? [duplicate]

1

I have a code that calculates the number of pages based on the number of data that is called from the database. But with the code it divides the number of data by 5, that is, the maximum number allowed, but the value can come decimal and so it can not calculate the pages well. Is there any way to round the value of eg 3.2 to 4 ?

    
asked by anonymous 09.11.2017 / 19:24

1 answer

1

Use:

ceil($number);

If you use:

ceil(3.6);

The result will be 4 .

    
09.11.2017 / 19:31