Home  >  Article  >  Backend Development  >  What does php end with?

What does php end with?

王林
王林Original
2019-09-23 13:14:215664browse

What does php end with?

We know that php files have the starting symbol . The starting symbol is necessary, but the ending symbol cannot be used indiscriminately.

When PHP is embedded in an HTML page, the terminator is necessary to distinguish code blocks. It is not recommended to add it at other times. If this is a program included by others, without this end character, many, many problems can be reduced.

For example: header,setcookie, session_startThere must be no output before these actions. If you accidentally add ?> after Visible characters (extra spaces, newlines), etc. that damage the page display will cause a "Header already sent" error. If you don't write it, you won't have this problem.

Example:

What does php end with?

What does php end with?

What does php end with?

What does php end with?

##The above content is for reference only!

Recommended tutorial:

PHP video tutorial

The above is the detailed content of What does php end with?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn