Home > Article > Backend Development > When include require utf-8 files in php, a blank line is generated at the top_PHP tutorial
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.