Why does PHP sometimes not write closed tag terminator?
Find some information, everyone on the PHP closed tag summary is as follows:
Benefits: If this is a program that someone else contains, without this terminator, you can reduce a lot of problems, such as: header, Setcookie, session_start These actions must not have output, if accidentally added to the?> behind the invisible character (extra space , newline characters) and other broken page display, will be reported "Header already sent" error, do not write the words will not have this problem. Alternatively, you can move the cursor directly to the end and then program.
Cons: In Dreamweaver view mode, it's a mess.
The official explanation for the PHP closing tag is: PHP closed tag?> in PHP is optional for PHP parser. However, if you use a closed tag, any space behind the closed tag by a developer, user, or FTP application may cause extra output, PHP errors, output that cannot be displayed, and blank pages. Therefore, all PHP files should omit this PHP closed tag, and insert a note to indicate that this is the file's bottom and locate the file in the relative path of the application. This will help you to make sure that the document is over and not truncated.
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.