- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
ceil() function in PHP
The ceil() function rounds a number to the nearest integer. The value is rounded up to the nearest greatest integer.
Syntax
ceil(num)
Parameters
num − The number to round up
Return
The ceil() function Returns the value rounded up to the nearest (up) integer.
Example
<?php echo(ceil(0.90) . "<br>"); echo(ceil(0.15) . "<br>"); ?>
Output
1<br>1<br>
Example
Let us see another example −
<?php echo(ceil(2)); ?>
Output
2
Example
Let us see another example −
<?php echo(ceil(8.9) . "<br>"); echo(ceil(-9.2) . "<br>") ?>
Output
9<br>-9<br>
Advertisements