Solutions for is_null and empty

Source: Internet
Author: User
Is_null and empty an empty arrayif (is_null ($ array) {will not execute here} if (empty ($ array) {will execute} What is the solution ?, An empty array is an array with 0 elements. the values of empty include null, 0, & quot;, '0', n is_null, and empty.
An empty array

If (is_null ($ array ))
{
Not executed here
}

If (empty ($ array ))
{
Yes
}

Why?

------ Solution --------------------
An empty array is an array with 0 elements.
------ Solution --------------------
Empty returns true if the variable is null, 0, "", '0', null, array ().
Isset returns false when determining null.
Is_null returns true if it is null. otherwise, false is returned.

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.