PHP | is_real() Function Last Updated : 27 Apr, 2020 Comments Improve Suggest changes Like Article Like Report The is_real() function is an inbuilt function in PHP which is used to check the given value is a real number or not. Syntax: bool is_real( mixed $var ) Parameters: This function accepts one parameter as mentioned above and described below: $var: It contains the value of variable that need to be check. Return Value: It returns TRUE if the given value of variable is real number, FALSE otherwise. Program 1: php <?php // PHP code to demonstrate // the is_real() function function square($num) { return (is_real($num)); } var_dump(square(9.09)); var_dump(square(FALSE)); var_dump(square(14)); var_dump(square(56.30)); ?> Output: bool(true) bool(false) bool(false) bool(true) Program 2: php <?php // PHP program to demonstrate the // is_real() function $variable_name1 = 67.099; $variable_name2 = 32; $variable_name3 = "abc"; $variable_name4 = FALSE; // Check given variable is real number or not if (is_real($variable_name1)) echo "$variable_name1 is a real value. \n"; else echo "$variable_name1 is not a real value. \n"; // Check given variable is real number or not if (is_float($variable_name2)) echo "$variable_name2 is a real value. \n"; else echo "$variable_name2 is not a real value. \n"; // Check given variable is real number or not if (is_float($variable_name3)) echo "$variable_name3 is a real value. \n"; else echo "$variable_name3 is not a real value. \n"; // Check given variable is real number or not if (is_float($variable_name4)) echo "FALSE is a real value. \n"; else echo "FALSE is not a real value. \n"; ?> Output: 67.099 is a real value. 32 is not a real value. abc is not a real value. FALSE is not a real value. Reference: https://www.php.net/manual/en/function.is-real.php Comment More infoAdvertise with us Next Article PHP | is_real() Function A ashokjaiswal Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | is_readable( ) Function The is_readable() function in PHP used to check whether the specified file exists and is readable or not. The name of the file is sent as a parameter to the is_readable() function and it returns True if the file exists and is readable. is_readable() function returns False for streams, for example, p 2 min read PHP is_scalar() Function PHP_scalar() function is an inbuilt function in PHP and is used to check whether a variable is a scalar or not. Syntax: bool is_scalar ( $var ) Parameter: This function accepts a single parameter as shown in the above syntax and described below. $var: Variable to check if it is a scalar or not. Retu 1 min read PHP | realpath( ) Function The realpath() function in PHP is an inbuilt function which is used to return the canonicalized absolute pathname. The realpath() function removes all symbolic links such as '/./' '/../' and extra '/' and returns the absolute pathname. The path is sent as a parameter to the realpath() function and i 2 min read PHP | is_string() Function The is_string() function is an inbuilt function in PHP which is used to check whether the given value is a string or not. Syntax: bool is_string( mixed $var ) Parameters: This function accepts one parameter as mentioned above and described below: $var: It contains the value that need to check. Retur 1 min read PHP | is_a() function The is_a() is a built-in function in PHP and is used to check whether a given object is of a given class or not. It also checks if the given class is one of the parents of the given object or not. Syntax: boolean is_a($object, $class) Parameters: This function accepts two parameters as shown in the 2 min read PHP | stream_is_local() Function The stream_is_local() function is an inbuilt function in PHP which is used to check if a stream is a local stream or URL. Syntax: bool stream_is_local( $stream ) Parameters: This function accepts single parameter $stream, which is used to specify the stream to be check. Return Value: This function r 1 min read PHP isset() Function The isset() function in PHP checks whether a variable is declared and not NULL. It returns true if the variable exists and has a non-NULL value, and false otherwise, without modifying the variable. Syntaxbool isset( mixed $var [, mixed $... ] )Parameters: This function accept one or more parameter a 3 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 PHP is_long() Function The is_long() function is an inbuilt function in PHP that is used to check whether the given value is a long integer or not. Syntax: bool is_long(mixed $value) Parameters: This function accepts a single parameter $value that holds the value which needs to check for a long integer. Return Value: This 1 min read PHP | is_null() Function The is_null() function is an inbuilt function in PHP which is used to find whether a variable is NULL or not. Syntax: boolean is_null ( $var ) Parameters: This function accepts a single parameter as shown in above syntax and described below. $var: Variable to check if it is NULL or not. Return value 2 min read Like