Home > php教程 > php手册 > body text

php中include require utf-8文件时顶部产生空行的

WBOY
Release: 2016-06-13 11:27:36
Original
853 people have browsed it

本文章来介绍关于php中include require utf-8文件时顶部产生空行的解决办法有需要学习的朋友可参考。

include()产生一个警告而require()则导致一个致命错误。换句话说,如果想在遇到丢失文件时停止处理页面就用

require()。include()就不是这样,脚本会继续运行。同时也要确认设置了合适的include_path。注意在 PHP 4.3.5

之前,包含文件中的语法错误不会导致程序停止,但从此版本之后会


关于include require utf-8文件时顶部产生空行解决办法

php中使用require函数加载utf8文件的时候会产生一个空行,这是由于在windows环境下编辑文件的时候会产生几个识

别utf8的字符,这些字符称为Unicode签名(BOM)。
特别是用记事本将网页文件由ANSI另存为UTF-8时易出现!

解决办法:

1. 可以通过在Dreamweaver中按Ctrl+J,在标题与编码中去除此选项;
2. 用EditPlus将文件另存为UTF-8(无BOM)文件。


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
Popular Recommendations
Popular Tutorials
More>
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!