Ask a retarded question.

Source: Internet
Author: User
How to judge the empty as long as there is no content to return True


$STR = 0;
!empty ($STR); I can't.


$STR = 0;
$str! = "; I can't.


$str = ";
Isset ($STR); Or not.

How can you let them not think of 0 as empty?

The result I want is that as long as the content is not empty, regardless of 0 not 0







Reply to discussion (solution)

Strlen ($STR) ===0

Try TypeOf Var_dump.

Strlen ($STR) ===0
Take the length of the three equals sign and learn a hand

Empty ($STR) is it OK? Why do you want to reverse?

Strlen ($STR) ===0

The first empty (0) PHP Take this seriously, the second $str!== ' ' This is OK, isset () is to determine that the variable is not present, you set an empty variable is also a variable AH.

Empty can.

Look at this article, the overall is quite comprehensive.
http://blog.csdn.net/timecolor/article/details/8762930

  • 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.