what will do ceil() and floor() in PHP?

Answer Posted / nilsoft

ceil()
Returns the next highest integer value by rounding up value
if necessary.

<?php
echo ceil(4.3); // 5
echo ceil(9.999); // 10
echo ceil(-3.14); // -3
?>



floor()

Returns the next lowest integer value by rounding down value
if necessary.
<?php
echo floor(4.3); // 4
echo floor(9.999); // 9
echo floor(-3.14); // -4
?>

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you connet mysql database with php?

784


Is nan in javascript?

717


How to get the ip address of the client?

8910


Distinguish between urlencode and urldecode?

730


Which is the best web server?

728


If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?

739


What is php limit?

720


Write down the benefits of php7?

808


What is static in php?

735


When use javascript vs php?

759


What is a controller in php?

753


What are the method available in form submitting?

737


What is meant by an associative array?

735


Can we set session value in javascript?

739


Can you extend a final defined class?

8711