PHP scripts and programs for Beginner to Master

php programs, php ready to use scripts & functions, css tutorials, html, javascripts, ajax examples for Beginner to Master

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.

I'm reading: PHP Math functions Ceil and FloorTweet this!

2 comments:

for more PHP tutorials please check http://smartbrainsacademy.in/knowledge-base

"Nice blog.. Thanks for sharing this blog information with us…

Web Development Company Chennai

Post a Comment