Why is the suffix of the PHPclass File Not. php?

Source: Internet
Author: User
& Amp; lt ;? Php {code ...}? & Amp; gt; github. comeasychenL...
Include 'phpbeautifier. Inc'; // why does this class end with. inc? $ Beauspace = new PhpBeautifier (); $ beauspace-> tokenSpace = true; // put space between tokens $ beauspace-> blockLine = true; // put empty lines between blocks of code (if, while etc) $ beauze-> optimize = true; // optimize strings (for now ), if a double quoted string does not contain variables of special carachters transform it to a single quoted string to save parsing time $ beauform-> file ('test. php', 'beautified. php ');

?>

Https://github.com/easychen/L...

Reply content:

Include 'phpbeautifier. Inc'; // why does this class end with. inc? $ Beauspace = new PhpBeautifier (); $ beauspace-> tokenSpace = true; // put space between tokens $ beauspace-> blockLine = true; // put empty lines between blocks of code (if, while etc) $ beauze-> optimize = true; // optimize strings (for now ), if a double quoted string does not contain variables of special carachters transform it to a single quoted string to save parsing time $ beauform-> file ('test. php', 'beautified. php ');

?>

Https://github.com/easychen/L...

Because it only marks a file, you can change the suffix to any valid character (even if you remove the suffix ).
The internal execution process of PHP is like this:

  1. Find the file corresponding to the file name or path;

  2. Reads the content of a file;

  3. Parse the content into PHP code and execute it.

Therefore, this has nothing to do with the suffix. here, the suffix is only used to identify this file, similar to XXX. tpl (Template) and so on.

Include can contain any type of file, as long as you have the permission to read, such as the following


  

Well, thank you. The above answers are correct, so pay attention to the security of include/require.

Thank you for inviting me. I just got a glimpse of this problem. The include command is used to introduce and run the specified file (the same as require ).

require includeAll types of text files are supported. the content in the referenced file is executed as php code (including

You can use require/include a txt, html, js, css, and so on. some PHP Trojans use this to bypass security tool detection.

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.