PHP ceil( ) Function Last Updated : 22 Jun, 2023 Comments Improve Suggest changes Like Article Like Report We have often used the ceiling function in mathematical problems to round up a decimal number to next greater integral value. PHP provides us with a built-in function ceil() to perform such operation. The ceil() function is a built-in function in PHP and is used to round a number to the nearest greater integer. Syntax: float ceil(value) Parameters: The ceil() function accepts a single parameter value which represents the number which you want to round up to the nearest greater integer. Return Value: The return type of the ceil() function is float as shown in the syntax. It returns the number which represents the value rounded up to the next highest integer. Examples: Input : ceil(0.70) Output : 1 Input : ceil(-4.1) Output : -4 Input : ceil(6) Output : 6 Below programs illustrate the ceil() function in PHP: When a positive number with decimal places is passed as a parameter: PHP <?php echo (ceil(0.70)); ?> Output: 1When a negative number with decimal places is passed as a parameter: PHP <?php echo (ceil(-4.1)); ?> Output: -4When a number with no decimal places is passed as a parameter: PHP <?php echo (ceil(6)); ?> Output: 6 Reference: https://www.php.net/manual/en/function.ceil.php Comment S Shubrodeep Banerjee Follow 0 Improve S Shubrodeep Banerjee Follow 0 Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Explore PHP Tutorial 8 min read BasicsPHP Syntax 4 min read PHP Variables 5 min read PHP | Functions 8 min read PHP Loops 4 min read ArrayPHP Arrays 5 min read PHP Associative Arrays 4 min read Multidimensional arrays in PHP 5 min read Sorting Arrays in PHP 4 min read OOPs & InterfacesPHP Classes 2 min read PHP | Constructors and Destructors 5 min read PHP Access Modifiers 4 min read Multiple Inheritance in PHP 4 min read MySQL DatabasePHP | MySQL Database Introduction 4 min read PHP Database connection 2 min read PHP | MySQL ( Creating Database ) 3 min read PHP | MySQL ( Creating Table ) 3 min read PHP AdvancePHP Superglobals 6 min read PHP | Regular Expressions 12 min read PHP Form Handling 4 min read PHP File Handling 4 min read PHP | Uploading File 3 min read PHP Cookies 9 min read PHP | Sessions 7 min read Like