Generally, the headers of all pages on our website are similar to those at the bottom, so we can put these similar codes into a file and load the header and the bottom file in each template file, in this way, we do not need to write the header and
PHP page Encoding declaration method in detail (header or meta)PHP page encoding declaration with header or meta implementation of PHP page encoding DifferencePHP header to define a PHP page for UTF encoding or GBK encodingPHP page is UTF encoded
This article discusses how to completely eliminate the Warning:cannot add header information-headers already sent in ... This is a puzzling mistake.
As long as you have written PHP code, I believe you have encountered this most of the time is not
Transfer from http://www.jb51.net/article/22501.htm
PHP header to define a PHP page for UTF encoding or GBK encoding
PHP page is UTF encoded
header ("content-type:text/html; Charset=utf-8 ");
PHP page is GBK encoded
header
There are two encoding format, one is the PHP file itself encoding format, such as EditPlus, such as editor when saving the file allows you to specify the file encoding format, the other is the PHP output text encoding format, this information only
1.header () function
The header () function is a very simple way to make a page jump in PHP. The main function of the header () function is to output HTTP protocol headers (headers) to the browser.
The header () function is defined as follows:
Fix Warning:cannot Modify header information-headers already sent by ...
Information often prompts: Cannot modify header information-headers already sent by (...). In fact, has achieved the desired effect, is this error message look uncomfortable,
PHP header to define a PHP page for UTF encoding or GBK encoding
PHP page is UTF encoded
Header ("content-type:text/html; Charset=utf-8 ");
PHP page is GBK encoded
Header ("content-type:text/html; charset=gb2312 ");
PHP page is BIG5
PHP Tutorial Configuration Chinese Narration
Let's see what you see, php.ini.
[PHP]
;;;;;;;;;;;; WARNING;;;;;;;;;;;;; This is the default settings file for new PHP installations.; By default, PHP installs itself with a configuration suitable for;
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.