How does PHP determine the data type? What are the PHP data type judging functions?

Source: Internet
Author: User
In PHP, how to determine the type of data, PHP to determine the common functions of the data type, in PHP to determine the type of string, numeric type, Boolean type, and other types of PHP variables, for your study reference.

PHP function for judging data types

first, how does PHP determine the data type? You can use the following function: Isset ()://variable declared empty ()://variable is null defined ():///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)://detects if the variable is a numeric or numeric string Is_bool ()://The detection variable is Boolean is_float ()://detection variable is floating point type and is_double,is_real () are the same usage I S_int ()://Check whether the variable is an integer Is_integer () the same usage is_string ()://Detect whether the variable is a string Is_object ()://Detect whether the variable is an object Is_array ()://Detection variable is an array is_ Null ()://Check whether the variable is a null value if it is case-sensitive

What are the PHP data type judging functions?

PHP data type, note that is_numeric () detects whether a variable is a numeric or numeric string that differs from Is_integer ().

Common data type Judgment functions: Is_bool (), Is_float (), Is_int (), is_string (), Is_object (), Is_array (), and Is_integer ().

  • Related Article

    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.