PHP's simplest template engine: PHP native template engine

Source: Internet
Author: User
Tags php foreach

... Well, adding a caching mechanism is perfect! I do not know that this is more than the regular template engine performance will be higher?

[PHP] Code

    1. $a = Array (
    2. ' A ', ' B ', ' C '
    3. );
    4. Require ' template/demo.php ';//reference template
    5. ?>
Copy Code

[PHP] Code

    1. Template file:
    2. Template testing
Copy Code

[PHP] Code

    1. Key values:
    2. Iteration of an array
    3. Smarty
    4. {foreach Item=na from= $a key=key}
    5. Key value: {$key}
    6. {/foreach}
    7. For PHP programmers that better understand?
    8. Smarty parsing template also use regular, PHP regular efficiency is not high where to go ...
Copy Code
The simplest, PHP, PHP
  • 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.