Home >Backend Development >PHP Tutorial >When include require utf-8 files in php, a blank line is generated at the top_PHP tutorial

When include require utf-8 files in php, a blank line is generated at the top_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:11:46759browse

This article will introduce the solution to the blank line generated at the top when include require utf-8 files in PHP. Friends who need to learn can refer to it.

include() produces a warning and require() results in a fatal error. In other words, if you want to stop processing the page when a missing file is encountered, use

require(). This is not the case with include() and the script will continue to run. Also make sure the appropriate include_path is set. Note that before PHP 4.3.5

, syntax errors in include files will not cause the program to stop, but from this version onwards


will be generated when including require utf-8 files. Empty line solution

When using the require function in PHP to load a utf8 file, a blank line will be generated. This is because several identifiers will be generated when editing the file in the windows environment

Identification of utf8 characters, these characters are called Unicode Signatures (BOM).
Especially when using Notepad to save web page files from ANSI to UTF-8!

Solution:

1. You can remove this option in title and encoding by pressing Ctrl+J in Dreamweaver;
2. Use EditPlus to File is saved as UTF-8 (no BOM) file.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/444629.htmlTechArticleThis article introduces the solution to the blank line at the top when include require utf-8 files in PHP. You need to learn. Friends can refer to it. include() produces a warning and require() produces a...
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