How does php determine the data type? What are php Data types judgment functions?

Source: Internet
Author: User
How does php determine the data type? What are php Data types judgment functions?
How to determine the data type in php, which common functions are used by php to determine the data type, and other php variable types such as string, number, and Boolean in php, for your reference.

Php functions for Determining data types

I. How does php determine the data type?You can use the following function: isset (): // whether the variable has declared empty (): // whether the variable is null defined (): // whether the constant has 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): // check whether the variable is a numeric or numeric string is_bool (): // check whether the variable is a Boolean is_float (): // check whether the variables are floating-point and is_double, is_real (). use is_int (): // check whether the variables are integer is_integer (). use 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 (): // check whether the variable is NULL or not.

II. php Data type judgment functions

Php Data type determination, pay attention to is_numeric () check whether the variable is a number or a number string with an is_integer ().

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.