PHP ceil() functionThe ceil() function is often used to calculate the mathematical problems. It is in-built function to find the round number up to the nearest integer. Note1 : To round a number down to the nearest integer, then use floor() function.Note2 : To round a floating-point number, then use round() function.Syntax:It returns the next highest value by rounding up value if necessary.
Example1Output: 1 Example2Output: 5 Example 3Output: -4 Example4Output: -6 Example 5Output: 66.41 66.4 Example 6Output: The actual value: 77.4 The ceil() used: 77.41 The round() used: 77.4
Next TopicPHP Math
|