Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

PHP Math functions Ceil and Floor

PHP has nice support for Mathematical processing. And for doing rounding off we generally need functions like ceil() and floor().

Lets see how to use these functions...

PHP ceil() Function

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

Check the code below


The output of the above code will be 1.

PHP floor() Function

The floor() function rounds off the value "DOWNWARDS" to the nearest integer.
Check the code below

The output of the above code will be 0.


This post first appeared on PHP Scripts And Programs For Beginner To Master, please read the originial post: here

Share the post

PHP Math functions Ceil and Floor

×

Subscribe to Php Scripts And Programs For Beginner To Master

Get updates delivered right to your inbox!

Thank you for your subscription

×