This article illustrates the difference and comparison 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 failure to judge, use the latter's (or ) ok. Note: Name there is no need to add the $ variable symbol, and value there to add the $ variable symbol.
2. When the value is empty (NULL):
?
1
2 just a test
Just a test
If the former is judged to be unsuccessful, the latter (or ) can recognize null as ""
3. Multidimensional array with subscript 0:
?
1
2 just a test
Just a test
The former can not be compiled by using if, and the EQ on the back will
I hope this article will help you with the PHP program design based on thinkphp.