Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / saurabh rastogi

$var=7.5;
$c_var=ceil($var);

echo $c_var; // Outputs 8


$var=7.5
$c_var=floor($var);

echo $c_var; // Outputs 7

Is This Answer Correct ?    29 Yes 2 No

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

Answer / nikunj

ceil() func. gives nearest max values of passing value.

floor() func. gives nearest min values of passing value.

see above example

Is This Answer Correct ?    14 Yes 2 No

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

Answer / paul

ceil() give you the upper number of a fraction.
eg.

ceil(3.0)=3
ceil(3.1)=4
ceil(3.3)=4
ceil(3.5)=4
ceil(3.7)=4

floor() does ceil()'s opposite it returns the lower number
of the fraction

floor(3.0)=3
floor(3.1)=3
floor(3.3)=3
floor(3.5)=3
floor(3.7)=3

Is This Answer Correct ?    9 Yes 0 No

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

Answer / 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

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

Answer / rakesh kumar nautiyal

ceil() return the absolute value of a given var while floor
() return a true value of given variable

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More PHP Interview Questions

What is laravel php?

0 Answers  


1.Where are the sessions storing ? 2.What are the contents of a session file ? 3.If the server is loaded with too many session files there is a possibility of server crash. How can we solve this issue? 4. How does php server identify that the particular session belongs to particular user ? For ex: If two users A and B logged from different machine, separate session files (say 1 and 2) will be created in the server. But how the php knows that 1 belongs to A and 2 belongs to B ?

4 Answers   PA Consulting, TCS,


How can you tell if a number is even or odd without using any condition or loop?

0 Answers  


What are hooks in php?

0 Answers  


What is in a cookie?

0 Answers  


What is the purpose of constant() function?

0 Answers  


How to remove the new line character from the end of a text line in php?

0 Answers  


How can we know the number of days between two given dates using PHP?

8 Answers   AZTEC, HCL, Navsoft,


Can we extend final class in php?

0 Answers  


Tell me when a conditional statement is ended with an endif?

0 Answers  


Tell me how a constant is defined in a php script?

0 Answers  


What is the w3c?

0 Answers  


Categories