What is ceil function php?
❮ PHP Math Reference Show ExampleRound numbers up to the nearest integer: echo(ceil(0.60) . " Try it Yourself » Definition and UsageThe ceil() function rounds a number UP to the nearest integer, if necessary. Tip: To round a number DOWN to the nearest integer, look at the floor() function. Tip: To round a floating-point number, look at the round() function. SyntaxParameter Values
Technical Details
❮ PHP Math Reference (PHP 4, PHP 5, PHP 7, PHP 8) ceil — Round fractions up Descriptionceil(int|float Returns the next highest integer value by rounding up Parametersnum The value to round Return Values Changelog
ExamplesExample #1 ceil() example
Scott Weaver / scottmweaver * gmail ¶ 14 years ago
ceiling(0, 1000); // 0 eep2004 at ukr dot net ¶ 4 years ago
steve_phpnet // nanovox \\ com ¶ 17 years ago
round_up (56.77001, 2); // displays 56.78 oktam ¶ 11 years ago
eep2004 at ukr dot net ¶ 4 years ago
aaron at mind-design dot co dot uk ¶ 18 years ago
Gemini_13 at torba dot su ¶ 7 years ago
themanwe at yahoo dot com ¶ 15 years ago
php is the best ¶ 10 years ago
eg at pensio dot com ¶ 9 years ago
roger_dupere at hotmail dot com ¶ 18 years ago
$num_rows > 0 ) {
Lexand ¶ 10 years ago
rainfalling at yahoo dot com ¶ 18 years ago
Bas Vijfwinkel ¶ 7 years ago
cedricaubert at gmail dot com ¶ 7 years ago
alesegdia at gmail dot com ¶ 9 years ago
AndrewS ¶ 11 years ago
sebastien dot thevenaz at gmail dot com ¶ 10 years ago
Anonymous ¶ 6 years ago
josoort at home dot nl ¶ 8 years ago
What is ceil and floor in PHP?Ceil() takes the number and rounds it to the nearest integer above its current value, whereas floor() rounds it to the nearest integer below its current value.
Why ceil function is used?CEIL() function in MySQL is used to return the smallest integer value which is either greater than or equal to the given input number.
What is ceil method?ceil() method rounds a number rounded UP to the nearest integer.
What is the difference between ceil () and floor () with examples?Example 1: Find ceil value of 5.534. Solution: Ceil value of 5.534 is an just greater than 5.534 i.e. 6.
...
Difference between the Floor and Ceil Function.. |