PHP | is_double() Function Last Updated : 21 Apr, 2020 Comments Improve Suggest changes Like Article Like Report 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 which need to check. Return Value: It is a boolean value i.e. either TRUE if $variable_name contains is a double value, otherwise returns FALSE. Below programs illustrate the is_double() function in PHP: Program 1: php <?php // PHP code to implement is_double() // function function square($num) { return (is_double($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 Program 2: php <?php // PHP code to implement is_double() // function $variable_name1 = 67.099; $variable_name2 = 32; $variable_name3 = "abc"; $variable_name4 = FALSE; // $variable_name1 is double value, gives TRUE if (is_double($variable_name1)) echo "$variable_name1 is a double value. \n"; else echo "$variable_name1 is not a double value. \n"; // $variable_name2 is not a double value, gives FALSE if (is_double($variable_name2)) echo "$variable_name2 is a double value. \n"; else echo "$variable_name2 is not a double value. \n"; // $variable_name3 is not a double value, gives FALSE if (is_double($variable_name3)) echo "$variable_name3 is a double value. \n"; else echo "$variable_name3 is not a double value. \n"; // $variable_name4 is not a double value, gives FALSE if (is_double($variable_name4)) echo "FALSE is a double value. \n"; else echo "FALSE is not a double value. \n"; ?> Output: 67.099 is a double value. 32 is not a double value. abc is not a double value. FALSE is not a double value. Reference: https://www.php.net/manual/en/function.is-double.php Comment More infoAdvertise with us Next Article PHP | is_double() Function A ashokjaiswal Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | is_countable() Function The is_countable() function is an inbuilt function in PHP which is used to check whether the content of the variable is countable or not. Syntax: bool is_countable ( mixed $var ) Parameters: This function accepts one parameter as mentioned above and described below: $var: This parameter holds the va 1 min read PHP | doubleval() Function The doubleval() is an inbuilt function in PHP which is used to get a float value of a variable. This function is an alias of floatval(). Syntax: doubleval ( $variable_name ) Parameters: This function accepts one parameter $variable_name as shown in above syntax. It is a mandatory parameter. This par 1 min read PHP is_file( ) Function The is_file() function in PHP is an inbuilt function which is used to check whether the specified file is a regular file or not. The name of the file is sent as a parameter to the is_file() function and it returns True if the file is a regular file else it returns False. Syntax: bool is_file($file) 2 min read PHP | is_callable() Function The is_callable() function is an inbuilt function in PHP which is used to verify the contents of a variable can be called as a function. It can check that a simple variable contains the name of a valid function, or that an array contains a properly encoded object and function name. Syntax: bool is_c 2 min read PHP | is_dir( ) Function The is_dir() function in PHP used to check whether the specified file is a directory or not. The name of the file is sent as a parameter to the is_dir() function and it returns True if the file is a directory else it returns False. Syntax: is_dir($file) Parameters Used: The is_dir() function in PHP 1 min read Like