PHP floor() Function Last Updated : 29 Jun, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report We sometimes need to round down the float values to the next lowest integer in our maths problems. PHP provides a built-in function floor() to get this task done through our PHP script. The floor() function in PHP rounds down the float value to the next lowest integer value. Syntax: float floor(value) Parameters: This function accepts the single parameter value which is rounded down to the next lowest integer. Return Value: The return type is a float value. It returns the next lowest integer value as a float which is rounded down, only if necessary. Examples: Input : floor(1.9) Output : 1 Input : floor(-1.8) Output : -2 Input : floor(4) Output : 4 Note: floor() function is opposite to ceil() function in PHP Below programs illustrate the floor() function in PHP. When a positive decimal number is passed. PHP <?php echo floor(2.8); ?> Output: 2When a negative decimal number is passed. PHP <?php echo floor(-3.4); ?> Output: -4When a number without decimal places is passed. PHP <?php echo floor(2); ?> Output: 2 Reference: https://www.php.net/manual/en/function.floor Comment More infoAdvertise with us Next Article PHP floor() Function G girish_nikam Follow Improve Article Tags : Web Technologies PHP PHP Programs Similar Reads PHP Callback Functions In PHP, the callback functions are related to the dynamic behavior and flexibility in code execution. They are used to pass custom logic or functions as arguments to other functions, letting developers change how a function behaves without changing its main structure. This makes the code more reusab 5 min read Anonymous recursive function in PHP Anonymous recursive function is a type of recursion in which function does not explicitly call another function by name. This can be done either comprehensively, by using a higher order function passing in a function as an argument and calling that function. It can be done implicitly, via reflection 2 min read How hash Function works in PHP ? Hashing Functions play a crucial role in securing sensitive data by converting it into a fixed-size string of characters, often a hash value or checksum. PHP provides several built-in hashing functions for various purposes, such as password hashing, data integrity verification, and more. The Hashing 2 min read PHP | Check if a variable is a function To determine whether a passed argument is a function or not, Few of the most preferred methods are shown below. Using is_callable() Function: It is an inbuilt function in PHP which is used to verify the contents of a variable in called as a function. It can check that a simple variable contains the 3 min read How to find out where a function is defined using PHP ? When we do projects then it includes multiple modules where each module divided into multiple files and each file containing many lines of code. So when we declare a function somewhere in the files and forget that what the function was doing or want to change the code of that function but can't find 3 min read Like