Smarty logical operator No. summary_php tutorial

Source: Internet
Author: User
Smarty logical operator number summary. I haven't used Smarty for a project for a long time. today, I suddenly want to modify some of my website's content, because my website was made a long time ago using the smarty template engine, I have not used Smarty for projects in some places for a long time. today, I suddenly want to modify some of my website's content, because my website was made using the smarty template engine a long time ago, I felt I had to search for the answer on the internet in some places. it seems that the long-lost smarty has been getting unfamiliar, so I have to study it quickly. Summarize the logical operator numbers of the Smarty template for future use.

Eq equal: equal
Neq not equal: not equal
Gt greater than: greater
Lt less than: less
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: non
Mod: modulus remainder
P by: Yes... Division
& And: and
| Or: or
Is [not] can p by be divisible by a certain number, for example: {if $ smarty. get. age is p by 3}... {/if}
Is [not] Whether the even is an even number. for example, $ a is [not] even by $ B ($ a/$ B) % 2 = 0,
Is [not] is odd? for example: $ a is not odd by $ B ($ a/$ B) % 2! = 0

{If $ _ global_password} indicates that the variable does not exist ....

{If $ _ global_password! = ''} Is used to judge whether variables and so on are not equal to null ....

The if statement and if in Smarty must be paired with/if. you can use the else and elseif clauses.

The template uses eq, ne, neq, gt, lt, lte, le, gte, ge, is even, is odd, is not even, is not odd, not, mod, p by, even by, odd by, = ,! =,>, <, <=,> = Logical operator numbers must be left blank with variables or constants.

Articles you may be interested in
  • Js restrictions: only English letters and numbers can be entered. Chinese characters and other special characters cannot be entered.
  • Smarty template retention variable summary
  • Smarty variable Operator summary
  • How to use variables in smarty include file
  • Smarty video tutorial sharing
  • Note the following when querying strings with single quotes and inserting strings with single quotes in Mysql:
  • Use php functions in the smarty template and how to use multiple functions for a variable in the smarty Template
  • Php uses header () to download files. the downloaded files prompt that they are damaged and cannot be opened.

...

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.