Php Flow » Php

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.

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.

1
echo ceil(0.65);

The output of the above code will be 1.

Did you enjoy this article? Share it!

About the Author:

Hi, This is Parvez Alam from India. I am software developer with 4 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

Random Posts

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=""> <strike> <strong>