Home > Backend Development > PHP Tutorial > Summary of smarty logical operation symbols_PHP tutorial

Summary of smarty logical operation symbols_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:31:09
Original
1080 people have browsed it

I haven’t used Smarty for a project for a long time. Today I suddenly have to change some things in my website, because my website was made with the smarty template engine a long time ago. After changing some parts, I feel that it is not enough. I searched the Internet for answers. It seems that I am already unfamiliar with smarty, which I haven’t seen for a long time. I need to catch up on it quickly. Let’s briefly summarize the logical operation symbols of Smarty templates for future use.

eq equal : equal
neq not equal:not equal to
gt greater than: greater than
lt less than: less than
lte less than or equal:less than or equal
gte great than or equal:greater than or equal
is even: It is an even number
is odd: It is an odd number
is not even: not an even number
is not odd is not an odd number
not:   🎜> mod: Find the modulus and remainder
div by: quilt. . . except
&& and : And
|| or : or
is [not] div by Whether it can be divided by a certain number, for example: {if $smarty.get.age is div by 3}...{/if}
is [not] even Whether it is an even number, for example: $a is [not] even by $b, that is ($a / $b) % 2 == 0,
is [not] odd Whether it is odd, for example: $a is not odd by $b, that is ($a / $b) % 2 != 0

{if $_global_password} is to determine whether the variable exists....

{if $_global_password!==''} is to judge whether the variables are not equal to empty....

The if statement and if in Smarty must appear in pairs with /if. Else and elseif clauses can be used.

Use eq, ne, neq, gt, lt, lte, le, gte, ge, is even, is odd, is not even, is not odd, not, mod, div by, even by, odd by in the template , ==, !=, >, <, <=, >= these logical operation symbols must be separated from variables or constants by spaces.

Articles you may be interested in

    How to restrict js to only enter English letters and numbers, but not Chinese and other special characters
  • Smarty template retains variables Summary
  • Smarty variable operator summary
  • smarty include file Method of using variables
  • smarty video tutorial sharing
  • Mysql query string with single quotes and insertion Things to note about strings with single quotes
  • Using php functions in smarty templates and how to use multiple functions for one variable in smarty templates
  • php uses header() to implement file downloads, downloaded files Solution to the problem that the prompt is damaged and cannot be opened

http://www.bkjia.com/PHPjc/764127.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764127.htmlTechArticleI haven’t used Smarty for a project for a long time. Today I suddenly have to change some things in my website because my website It was made using the smarty template engine a long time ago. I changed some places...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template