Home > Article > Backend Development > Spaces appear when include require utf-8 files in php_PHP tutorial
When using the require function in PHP to load a utf8 file, a blank line will be generated. This is because when editing the file in the windows environment, several characters that recognize utf8 will be generated. These characters are called Unicode signatures (BOM).
Require is used as require("MyRequireFile.php");. This function is usually placed at the front of the PHP program. Before the PHP program is executed, it will first read in the file specified by require and make it a part of the PHP program web page. Commonly used functions can also be introduced into web pages in this way.
This is especially true 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 save the file as a UTF-8 (no BOM) file.