Why sometimes php does not write a closed tag Terminator? After looking for some information, we can summarize the PHP closed labels as follows: Advantages: if this is a program included by others, without this Terminator, it can reduce many problems, such: header, setcookie, and session_start cannot be output before these actions? & Gt; when invisible characters (extra spaces, line breaks) are added to the backend to destroy the page display, why does php sometimes not write a closed tag Terminator?
I found some information and summarized the PHP closed labels as follows:
Benefit: if this is a program 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 When invisible characters (extra spaces and line breaks) are added to the backend to destroy the page display, the "Header already sent" error will be reported. if you do not write it, this problem will not occur. In addition, you can directly move the cursor to the end and then program.
Disadvantage: a mess in dreamweaver view mode.
The official explanation for PHP closed tags is: PHP closed tags?> PHP analyzer is optional in PHP. However, if you use closed tags, any developer, user, or the spaces after inserting the closed tag in the FTP application may cause redundant output, php errors, and subsequent output failures or blank pages. Therefore, all php files should omit this php closed tag and insert a comment to indicate that this is the bottom of the file and locate the relative path of the file in this application. This will help you determine that the file has been ended rather than deleted.
Improper:
Echo "Here's my code !";
?>
Appropriate:
Echo "Here's my code !";
/* End of file myfile. php */
/* Location:./system/modules/mymodule/myfile. php */
Therefore, should php code be omitted?> End identifier.