PHP floor() Function

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

Syntax :

floor(int $number);

Parameter,

$number: Required. It is a number.

Return Values :

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

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

Example :

<?php
echo "<br><br> Get a round positive nearest down integer number : ".floor(13.9);
echo "<br><br> Get a round positive nearest down integer number : ".floor(55);
echo "<br><br> Get a round negative nearest down integer number : ".floor(-67.3);
echo "<br><br> Get a round negative nearest down integer number : ".floor(-76.5);
?>

Comments

Leave a Reply

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

98178