Questions about the Include HTML file in PHP, why HTML can be executed in PHP

Source: Internet
Author: User

Before the tutorial in W3SHXXL, the above explanation of include is to copy the specified file to the place where this instruction was executed.

This is really a pit to me ....

When it comes to MVC, the controller displays the view with an include HTML view file, which is obviously unreasonable if the HTML can be parsed directly in the PHP tag, as described above.

Finally solve the problem or rely on PHP manual. Sure enough, the handbook is still in the future, we must develop the habit of reading manuals before encountering problems.

According to the manual explanation:

When the include contains a file and executes the file, it exits PHP mode and parses the file in HTML mode.

This is why HTML files must be defined in PHP tags if you want to insert PHP.

Questions about the Include HTML file in PHP, why HTML can be executed in 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.