Php framework-ThinkPHP's HTML template file uses PHP super global variables. Why is this format used?

Source: Internet
Author: User
The second line of {code...} is for the tutorial. The first line is for my own test. The tutorial does not. The two outputs are the same. Why are 2nd types used in the tutorial? Is it for security reasons or other factors? Thank you.
  • {$ _ SERVER ["REQUEST_URI"]}
  • {$ Think. SERVER. REQUEST_URI}
  • The second line is for the tutorial. The first line is for my own test.

    The two outputs are the same. Why are 2nd output types used in the tutorial?

    Is it for security reasons or other factors?

    Thank you.

    Reply content:
  • {$ _ SERVER ["REQUEST_URI"]}
  • {$ Think. SERVER. REQUEST_URI}
  • The second line is for the tutorial. The first line is for my own test.

    The two outputs are the same. Why are 2nd output types used in the tutorial?

    Is it for security reasons or other factors?

    Thank you.

    For example, {$ _ SERVER ["REQUEST_URI"]} directly accesses the server variable {$ Think. SERVER. REQUEST_URI} is encapsulated by tp. Of course, the second type will not be described in the tutorial. There are too many tp chicken ribs.

    It seems that TP is not very useful in doing so. It is more efficient to use native, saving compilation, and the variables after compilation are the same.

    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.