How to use floor in PHP

This article describe about floor() Function in PHP.
  • 1283

floor() Function

The value of a number rounded downwards to the nearest integer use floor() function.

Syntax

floor(x)

 

Parameter Description
x define a number.

Example

<html>
<body>
<?php
echo(floor(1.70) . "<br />");
echo(floor(0.70) . "<br />");
echo(floor(6) . "<br />");
echo(floor(6.1) . "<br />");
echo(floor(-7.1) . "<br />");
echo(floor(-7.9))
?>
</body>
</html>

 

Output


floorphp.jpg

You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.