PHP ceil( ) Function Last Updated : 22 Jun, 2023 Summarize Comments Improve Suggest changes Share 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: http://php.net/manual/en/function.ceil.php Comment More infoAdvertise with us Next Article PHP ceil( ) Function S Shubrodeep Banerjee Follow Improve Article Tags : Misc Web Technologies PHP PHP-math PHP-function +1 More Practice Tags : Misc Similar Reads PHP eval() Function PHP eval() function in PHP is an inbuilt function that evaluates a string as PHP code. Syntax: eval( $string ) Parameters: This function accepts a single parameter as shown in the above syntax and described below. $string: It must consist of a valid PHP code to be evaluated but should not contain op 2 min read PHP | exit( ) Function The exit() function in PHP is an inbuilt function which is used to output a message and terminate the current script. The exit() function only terminates the execution of the script. The shutdown functions and object destructors will always be executed even if exit() function is called. The message 2 min read PHP | ftell( ) Function The ftell() function in PHP is an inbuilt function which is used to return the current position in an open file. The file is sent as a parameter to the ftell() function and it returns the current file pointer position on success, or FALSE on failure.Syntax:Â Â ftell( $file ) Parameters Used: The ftel 2 min read PHP end() Function The end() function is an inbuilt function in PHP and is used to find the last element of the given array. The end() function changes the internal pointer of an array to point to the last element and returns the value of the last element.Syntax:end($array)Parameters:This function accepts a single par 2 min read PHP define() Function The define() function is basically used by programmers to create constant. Constants in PHP are very similar to variables and the only difference between both are the values of constants can not be changed once it is set in a program. define() returns a Boolean value. It will return TRUE on success 2 min read Like