Smarty Logical Operation symbol Summary _php tutorial

Source: Internet
Author: User
Tags mysql query
For a long time did not use Smarty to do projects, and today suddenly to change their own website inside some things, because my site is a long time ago with smarty template engine do, change some places on the feeling still have to search the answer on the Internet, it seems to the long-lost Smarty has started unfamiliar, hurriedly tutorial. Make a summary of the logical operation symbols for Smarty templates for later use.

EQ Equal: Equal
NEQ not equal: Not equal to
GT greater than: greater than
Lt less than: smaller than
LTE lesser than or equal: less than or equal to
GTE great than or equal: greater than or equal to
is even: an even number
Is odd: it is odd
Is isn't even: not even
Is isn't odd not an odd number
Not: Non-
MoD: Finding the modulus and taking the remainder
Div by: ... Except
&& and: and
|| Or: OR
Is (not) div by can be divisible by a 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 i.e. ($a/$b)% 2 = = 0,
Is "not" odd is odd, for example: $a is not odd by $b i.e. ($a/$b)% 2! = 0

{if $_global_password} is determined that the variable is not present ....

{if $_global_password!== '} is a judgment variable etc. not equal to null ....

The IF statement and the IF in Smarty must appear in pairs of/if. You can use the else and elseif clauses.

The templates 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, = =,! =, >, <, <=, >= These logical operation symbols must be and variables or constants with the empty open.

Articles you may be interested in

    • JS limit can only input English letters and numbers, can not input Chinese and other special characters of the method
    • Smarty Template Retention Variables Summary
    • Smarty Variable operator Summary
    • Smarty include file methods for using variables
    • Smarty Video Tutorial Share
    • MySQL query with single quotation mark string and insert with single quote string need to pay attention to the problem
    • Use PHP functions in Smarty Templates and how to use multiple functions for a variable in a smarty template
    • PHP with header () to achieve file download, download the file hint is broken can not open the solution

http://www.bkjia.com/PHPjc/764127.html www.bkjia.com true http://www.bkjia.com/PHPjc/764127.html techarticle For a long time did not use Smarty to do the project, today suddenly to change their own website inside some things, because my site is a long time ago with the Smarty template engine to do, change to some places ...

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