Home  >  Article  >  Backend Development  >  Spaces appear when include require utf-8 files in php_PHP tutorial

Spaces appear when include require utf-8 files in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:14:211047browse

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.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/628999.htmlTechArticleWhen using the require function in php to load a utf8 file, a blank line will be generated. This is due to editing in a windows environment. When the file is generated, several characters that recognize utf8 will be generated. These characters are called...
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