What is PHP floor() function?
With the help of the floor()
function, we can convert a numeric value to it’s next lower integer value.
Example of floor()
function in PHP:
<?php
$a=-145.13;
$result=floor($a);
echo "Floor value of $a is $result"; // Output: Floor value of -145.13 is -145
?>
Learn more about the similar topics:
Tutorials |
---|
PHP Functions |
Exercises & Assignments |
---|
Factorial program in PHP using recursive function |
Write a PHP program to check if a person is eligible to vote |
Write a PHP program to calculate area of rectangle |
Interview Questions & Answers |
---|
What is PHP Function? |
What is PHP floor() function? |