PHP include any file or URL to introduce _php instance

Source: Internet
Author: User
Tags php code

Practice the truth, write a simple file PHP file include a JS file, the implementation of no error or warning information, and see the contents of the file containing JS is printed. It is therefore concluded that the include target file can be of any type.

Now look back at the official documentation included, which says, "When a file is contained, the parser moves out of PHP mode at the beginning of the target file and into HTML mode to recover at the end of the file." For this reason, any code that needs to be executed as a PHP code in the target file must be included in a valid PHP start and end tag. "Note that the HTML schema, the PHP code must be included in a valid PHP tag," and understand its meaning, it implicitly shows that include can be any type of file.

In addition, after 4.3.0, the include target file can also be a URL, provided that you need to set allow_url_include to on in the configuration.

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.