English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Fonction floor() dans PHP

Theceil()The function rounds the number to the nearest integer.

Syntax

floor(num)

parameter

  • num-the number to be rounded

returns

Thefloor()The function returns the value rounded to the nearest integer (down).

Example

<?php
   echo(floor(0.10)) . "<\n>");
   echo(floor(0.55))
?>

Output result

0
0

Let's see another example-

Example

<?php
   echo(floor(9));
?>

Output result

9

Let's see another example-

Example

<?php
   echo(floor(7.8) . "\n");
   echo(floor(-4.2));
?>

Output result

7
-5