Home > Backend Development > PHP Tutorial > How to determine data type in php? What are the PHP data type judgment functions?

How to determine data type in php? What are the PHP data type judgment functions?

WBOY
Release: 2016-07-25 08:51:17
Original
2423 people have browsed it
How to determine the data type in PHP, what are the commonly used functions in PHP to determine the data type, and the functions to determine the string type, numeric type, Boolean type and other PHP variable types in PHP for your reference.

php function to determine data type

1. How does PHP determine the data type? You can use the following functions: isset(): //Whether the variable has been declared empty(): //Whether the variable is empty defined(): //Whether the constant has been defined define() array_key_exists(mixed key, array search): //Check whether the given key name or index exists in the array

is_numeric (mixed var): //Detect whether the variable is a number or a numeric string is_bool(): // Check whether the variable is of Boolean type is_float(): // Check whether the variable is a floating point type. The usage is the same as is_double and is_real(). is_int(): // Check whether the variable is an integer. Same usage as is_integer() is_string(): // Check whether the variable is a string is_object(): // Check whether the variable is an object is_array(): // Check whether the variable is an array is_null(): // Detect whether the variable is NULL and whether the value is NULL is case-sensitive

2. What are the PHP data type judgment functions? PHP data type judgment, note that is_numeric() detects whether the variable is a number or a numeric string, which is different from is_integer().

Commonly used data type judgment functions: is_bool(), is_float(), is_int(), is_string(), is_object(), is_array() and is_integer().

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template