PHP page uses include to introduce headerphp and there is a blank line above the header. php include Usage of include html include

WBOY
Release: 2016-07-29 08:48:43
Original
1206 people have browsed it

This problem has been bothering me for a long time. This problem is solved here. The key lies in the encoding of the code.

The encoding format used in the header.php of my page is UTF-8 format with BOM. Modify the code with BOM format to no BOM, so that the blank line in the header disappears.

UTF-8 BOM is also called UTF-8 signature. In fact, UTF-8 BOM has no effect on UFT-8. It is a BOM added to support UTF-16 and UTF-32. The meaning of BOM signature is to tell The encoding used by the editor for the current file is convenient for the editor to identify. However, although the BOM is not displayed in the editor, it will produce output, just like an extra blank line.

But after adding this, there are garbled characters on the page, plus , please note that this cannot be written as < ;?php header("Content-type:text/html;charset=utf8");?>, otherwise the IE browser will still have garbled characters.

The above introduces the use of include to introduce header in PHP pages. When PHP appears, there is a blank line above the header, including include and header content. I hope it will be helpful to friends who are interested in PHP tutorials.

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 Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!