ceil()
Published May 26, 2023
Contribute to Docs
The ceil()
function returns the next highest integer value of the fractional argument.
Syntax
$result = ceil(n);
Where n
is the fractional number to find the next highest integer value of.
Example
This example demonstrates the usage of the ceil()
function with three different arguments, and outputs results of each on a new line:
<?phpecho ceil(9.4)."</br>";echo ceil(6.01)."</br>";echo ceil(-1.637);?>
It results in the following output:
107-1
Codebyte Example
Using ceil()
to return the next highest integer value of 2.718
:
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.