[Php] php file does not require php end mark.

Source: Internet
Author: User
I have never been quite clear why I don't use it in the PHP file "?" Note: The End mark of the PHP code segment at the end of the file can be avoided. In some cases, you can use include () or require () it will be better to omit it, so that the unexpected white space will not appear at the end of the file, and the output can still be

I have never been quite clear why I don't use it in the PHP file "?" Note: The End mark of the PHP code segment at the end of the file can be avoided. In some cases, you can use include () or require () it will be better to omit it, so that the unexpected white space will not appear at the end of the file, and the output can still be

I have never been quite clear why I didn't use PHP files. "?>" Benefits:Note: The End mark of the PHP code segment at the end of the file can be omitted. In some cases, it is better to omit include () or require, in this way, unexpected white spaces will not appear at the end of the file, and the response header can still be output later. It is also convenient to use the output buffer, so you will not see unexpected white spaces generated by the contained files.

Omitted


If this is a program that is included by others and does not have this Terminator, it can reduce many problems, such as header, setcookie, and session_start, there cannot be output before these actions, if you are not careful An error occurs when spaces are added to the backend. In addition, you can directly move the cursor to the end and then program.

For example:

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.