- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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>
- Related Articles
- PHP ceil() Function
- Find ceil of a/b without using ceil() function in C++.
- floor() and ceil() function Python
- file_exists() function in PHP
- basename( ) function in PHP
- chgrp()function in PHP
- chmod() function in PHP
- chown() function in PHP
- clearstatcache() function in PHP
- copy() function in PHP
- delete() function in PHP
- dirname()function in PHP
- disk_free_space() function in PHP
- disk_total_space() function in PHP
- diskfreespace() function in PHP

Advertisements