PHP Data type judgment

Source: Internet
Author: User

There was a bit of a problem with the STBSTR () function today, because I put the results in the IF condition. When the first position is found, return 0.

In PHP, when condition = 0 is translated to false.

A simple way to wrap one layer

Is_int () Determines whether the number is not.

Isset ():                        ///variable declared empty ():                        //variable is empty 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_array ()://The detection variable is an array is_numeric (mixed var):                //Detection variable is a numeric or numeric word String Is_bool ():            //Check whether the variable is Boolean is_float ():            //Detect whether the variable is floating point and is_double,is_real () are the same usage is_int ():            //Detection variable is an integer is _integer () The same usage is_string ():            //detects if the variable is a string Is_object ():            //detects if the variable is an object Is_null ():            //detection variable is NULL Whether the value is null case sensitive

The basic function is still very useful.

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.