Learn about data types in PHP and how to work with them.
|
NULL NULL Type and Value |
NULL is a data type that represents the absence of a value. A variable also has the NULL type when it is explicitly assigned the null value. The NULL type has only one value: the case-insensitive constant null. |
|---|---|
|
gettype() Get the Data Type of a Variable as a String |
The gettype() function returns the data type of a given value as a string. It's useful for checking a variable's data type. |
|
is_int() Check if Integer |
The is_int() function checks whether a given value is an integer. It returns true if the value passed as an argument is an integer; otherwise, it returns false. |
|
is_float() Check if Float |
The is_float() function checks whether a given value is a float. It returns true if the value passed as an argument is a float; otherwise, it returns false. |
|
is_numeric() Check if Numeric |
The is_numeric() function checks whether a given value is a number or a numeric string. It returns true if the value passed as an argument is a number or a numeric string; otherwise, it returns false. |
|
is_string() Check if String |
The is_string() function checks whether a given value is a string. It returns true if the value passed as an argument is a string; otherwise, it returns false. |
|
is_array() Check if Array |
The is_array() function checks whether a given value is an array. It returns true if the value passed as an argument is an array; otherwise, it returns false. |
|
is_bool() Check if Boolean |
The is_bool() function checks whether a given value is a boolean. It returns true if the value passed as an argument is a boolean; otherwise, it returns false. |
|
is_object() Check if Object |
The is_object() function checks whether a given value is an object. It returns true if the value passed as an argument is an object; otherwise, it returns false. |
|
is_resource() Check if Resource |
The is_resource() function checks whether a given value is a resource. It returns true if the value passed as an argument is a resource; otherwise, it returns false. |
|
is_null() Check if NULL |
The is_null() function checks whether a given value is NULL. It returns true if the value passed as an argument is NULL; otherwise, it returns false. |