Home >Backend Development >PHP Tutorial >Usage examples of number, character and object judgment functions in php, php examples_PHP tutorial
The examples in this article describe the usage of number, character and object judgment functions in PHP. Share it with everyone for your reference. The specific analysis is as follows:
In PHP, judging numbers, characters, objects, arrays, etc. includes functions such as is_bool(), is_int(), is_integer(), is_float(), is_real(), is_object() and is_array(). I don’t know. How much do you know.
1. Double precision number judgment: is_double
is_double -- alias of is_float()
Description: This function is an alias function of is_float(), the code is as follows:
Description: This function is an alias function of is_int(), the code is as follows:
Description: bool is_object(mixed var)
If var is an object, return TRUE, otherwise return FALSE, the code is as follows:
Description: bool is_string(mixed var)
If var is a string, return TRUE, otherwise return FALSE, the code is as follows:
Description: bool is_numeric(mixed var)
If var is a number or numeric string, it returns TRUE, otherwise it returns FALSE. The code is as follows:
Here is just a brief introduction to the object, number, and character judgment functions in PHP. The difficulty is relatively simple. I hope this article will be helpful to everyone's PHP programming.