PHP ceil() Function

PHP ceil() Function is used to get round a number up to the nearest integer for floating-point number. A ceil() function is built-in function in PHP.

Syntax :

ceil(int $number);

Parameter,

$number: Required. It is a number.

Return Values :

It returns round up number up to nearest integer for floating-point number.

Let's see below example to understand php ceil() Function in details.

Example :

<?php
echo "<br><br> Get a round positive integer number : ".ceil(34.7);
echo "<br><br> Get a round positive integer number : ".ceil(14);
echo "<br><br> Get a round negative integer number : ".ceil(-23.2);
echo "<br><br> Get a round negative integer number : ".ceil(-10.5);
?>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

71777