PHP is_float() Function Last Updated : 04 Apr, 2023 Comments Improve Suggest changes Like Article Like Report PHP is_float() is an inbuilt function in PHP. The is_float() function is used to find whether a variable is a float or not. Syntax: boolean is_float($variable_name) Parameter: This function contains a single parameter as shown in the above syntax and described below $variable_name: the variable we want to check. Return value: It is a boolean function so returns TRUE when $variable_name is an integer, otherwise FALSE. The below example illustrates the working of the function is_float(). Example 1: PHP <?php // php code demonstrate working of is_float() $variable_name1 = 67.099; $variable_name2 = 32; $variable_name3 = "abc"; $variable_name4 = FALSE; // $variable_name1 is float, gives TRUE if (is_float($variable_name1)) echo "$variable_name1 is a float value. \n"; else echo "$variable_name1 is not a float value. \n"; // $variable_name2 is not float, gives FALSE if (is_float($variable_name2)) echo "$variable_name2 is a float value. \n"; else echo "$variable_name2 is not a float value. \n"; // $variable_name3 is not float, gives FALSE if (is_float($variable_name3)) echo "$variable_name3 is a float value. \n"; else echo "$variable_name3 is not a float value. \n"; // $variable_name4 is not float, gives FALSE if (is_float($variable_name4)) echo "FALSE is a float value. \n"; else echo "FALSE is not a float value. \n"; ?> Output: 67.099 is a float value. 32 is not a float value. abc is not a float value. FALSE is not a float value. Example 2: PHP <?php // PHP code demonstrate working of is_float() function square($num) { return (is_float($num)); } echo square(9.09) ."\n"; // outputs '1'. echo square(FALSE) ."\n"; // gives no output. echo square(14) ."\n"; // gives no output. echo square(56.30) ."\n"; // outputs '1' ?> Output: 1 1 Reference: http://php.net/manual/en/function.is-float.php Comment More infoAdvertise with us Next Article PHP is_float() Function S sid4321 Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads p5.js float() function The float() function in p5.js is used to get the floating point representation of the given string as a parameter. Syntax: float(String) Parameters: This function accepts a single parameter String which is used to be converted into its floating point representation. Return Value: It returns the conv 2 min read PHP | floatval() Function The floatval() function is an inbuilt function in PHP which returns the float value of a variable. Syntax: float floatval ( $var ) Parameters: This function accepts one parameter which is mandatory and described below: $var: The variable whose corresponding float value will be returned. This variabl 1 min read PHP fmod() Function fmod stands for Floating Modulo. Modulo calculates the remainder of a division which is generally noted with the '%' symbol. However, the general modulo expression expects both the divisor and dividend to be of integer type, this is a great limitation to such an important operation. In PHP the fmod( 2 min read PHP | is_double() Function The is_double() function is an inbuilt function in PHP which is used to find whether the given value is a double or not. Syntax: bool is_double( $variable_name ) Parameters: This function accepts one parameter as mentioned above and described below: $variable_name: This parameter holds the value whi 2 min read PHP atan( ) Function Trigonometry is an important part of mathematics and PHPâs math functions provides us with some functions which are very useful for calculations involving trigonometry. One of such function is atan() function. The atan() function in PHP is used to find the arc tangent of an argument passed to it whi 2 min read Like