Home  >  Article  >  Backend Development  >  What does php floor function mean?

What does php floor function mean?

藏色散人
藏色散人Original
2019-05-23 10:39:056111browse

In PHP, the floor() function means "round down", or "round down" or "round toward zero", which is used to round down to the nearest integer. , the syntax is "floor(number)"; it can return the largest integer not larger than the parameter number. If there is a decimal part, it will be rounded directly.

What does php floor function mean?

What does the floor function mean?

floor function, its function is to "round down", or When it comes to "rounding down" or "rounding toward zero", that is, taking the largest integer that is no greater than The largest integer value of the value.

Floor function: round down to the nearest integer.

Syntax:

floor(number)

Parameters:

number, required, a number.

Description: Return the next integer that is not greater than the parameter number. If there is a decimal part, it will be rounded off directly.

php floor() function example

<?php
$i = 66.7;
$i = floor($i);
$j = -66.7;
$j = floor($j);
echo $i."*****".$j
?>

Output:

66*****-67

The above is the detailed content of What does php floor function mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn