PHP Math functions

PHP has great support with Mathematical processing and operations.PHP has very rich functions high level programming language.We can use these MATH function to addition of number, subtraction addition of number,multiplication addition of number and many other mathematical operation.In This tutorial we will understand simple use of PHP Mathematics fucntion with sample code.

Checkout other tutorial of PHP,

There are two ceil and floor for doing rounding off number.

Below are simple steps for how to use these functions.

PHP floor()

The floor() function rounds off the value down to the nearest integer.

Select Code
1
echo floor(0.65);

The output of the above code will be 0.

PHP ceil()

The ceil() function rounds the value up to the nearest integer.

Select Code
1
echo ceil(0.65);

The output of the above code will be 1.