thinkphp template tags if and eq differences and comparison example analysis _php tutorials

Source: Internet
Author: User

thinkphp template tags if and eq differences and comparison example analysis


The examples in this article describe the differences and comparisons between the thinkphp template label if and EQ. Share to everyone for your reference. The specific analysis is as follows:

In the TP template language. Both if and EQ can be used for comparison of variables. Summarize the following points:

1. Comparison of two variables:

?

1

2

  

If the former is a judgment failure, use the latter's (or ) ok. Note: Name there is no need to add the $ variable symbol, and value there is to add the $ variable symbol.

2. There is also a value of NULL (NULL) When:

?

1

2 just a test

   Just a test

If the former is a judgment failure, the latter (or ) can be used to recognize null as ""

3. When the multi-dimensional array and subscript is 0:

?

1

2 just a test

   Just a test

The former with if is simply not compiled, with the back of the EQ can be

I hope this article is helpful to everyone based on thinkphp PHP program design.

http://www.bkjia.com/PHPjc/1025334.html www.bkjia.com true http://www.bkjia.com/PHPjc/1025334.html techarticle thinkphp template label if and EQ differences and comparison examples of this article describe the difference and comparison between the thinkphp template label if and EQ. Share to everyone for your reference. The specific analysis is as follows: ...

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