Differences between empty, isset, and is_null in PHP

Source: Internet
Author: User

Introduction: This is a detailed page on the differences between empty, isset, and is_null in PHP. It introduces empty, isset, is_null, PHP, differences between empty, isset, and is_null in PHP are related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 357333 'rolling = 'no'>
Empty

If the variable is not null or a non-zero value, empty () returns false. In other words, "", 0, "0", null, false, array (), VAR $ var, undefined, and objects without any attributes will be considered empty, if VaR is null, true is returned.

Isset

If the variable exists (not null), true is returned; otherwise, false (including undefined) is returned ). If the value of a variable is set to null, false is returned. If a variable is unset, the variable is canceled. Note that isset has special processing for null variables.

Is_null

Checks whether the input value [value, variable, expression] is null. Only if one variable is defined and its value is null, true is returned. otherwise, false is returned. [an error will occur after an undefined variable is passed in! ].

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/357333.html pageno: 2.

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.