Home > Backend Development > PHP Tutorial > The reason why there cannot be output before header and session_start in PHP_PHP Tutorial

The reason why there cannot be output before header and session_start in PHP_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:56:35
Original
852 people have browsed it

The reason why there cannot be output before header and session_start in PHP is analyzed below.

In the http transmission text, it is stipulated that the order of header and content must be: header first and content last, and the format of the header must meet the format of "keyword: valuen".

1. If there is output content before the header is output, it will cause a misunderstanding of the header (although it is now fault-tolerant). For example, if it does not meet the format of "keyword: valuen", it is fine, but it is directly wrong, but it does satisfy After the "keyword: valuen" format, does the client install the wrong interpretation, or does it follow the correct interpretation?

2. When the session is opened, it will implicitly trigger whether to use header ("Set-Cookie: sid=xxxxxx"), which is actually an implicit header call

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632157.htmlTechArticleThe reason why there cannot be output before header and session_start in PHP is analyzed below. In the http transmission text, it is stipulated that the order of header and content must be: header first, content first...
Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template