❮ PHP Variable Handling Reference ExampleCheck whether a variable is of type float or not: <?php $b = 0; $c = 32.5; $d = "32"; $e = true; $f = "null"; $g = 1.e3; Try it Yourself » Definition and UsageThe is_real() function checks whether a variable is of type float or not. This function is an alias of is_float(). SyntaxParameter Values
Technical Details
❮ PHP Variable Handling Reference View Discussion Improve Article Save Article View Discussion Improve Article Save Article 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:
Return Value: It returns TRUE if the given value of variable is real number, FALSE otherwise. Program 1:
Output: bool(true) bool(false) bool(false) bool(true) Program 2:
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 Submit a Pull Request Report a Bug (PHP 4, PHP 5, PHP 7, PHP 8) is_real — Alias of is_float() DescriptionThis function is an alias of: is_float(). Warning This alias was DEPRECATED in PHP 7.4.0, and REMOVED as of PHP 8.0.0. +add a note User Contributed NotesThere are no user contributed notes for this page. |