PHP Math functions

PHP has great support with Mathematical processing.PHP has very rich functions, 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.

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.

echo ceil(0.65);

The output of the above code will be 1.

The following two tabs change content below.
Hi, This is Parvez Alam from India. I am software developer with 6 years’ experience in web development. I have submitted articles on PHP, Mysql, Magento,CSS, HTML, jQuery, web designing and social API. You can subscribe to my blog via RSS/Twitter/Google plus and Facebook. parvez1487(at)gmail(dot)com

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>