为什么Unicode PHP文件会生成换行符? [英] Why does a Unicode PHP file generate a line break?
本文介绍了为什么Unicode PHP文件会生成换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的admin.php文件中包含以下代码:
I have this code in my admin.php file:
<?php include("include/php/auth.inc.php"); ?>
<?php if (user_Type() != "admin") {header("location: index.php"); exit(0);} ?>
<?php include("include/php/admin/admin.inc.php"); ?>
<?php include("header.php"); ?>
<?php include ("menu.php"); ?>
<?php include ("admin_Panel.php"); ?>
<?php include "footer.php" ?>
在第3行中,我包含一个名为admin.inc.php
的PHP文件,该文件仅包含某些功能,并且不包含任何HTML标记或<?php
和?>
之外的任何字符.当我将文件编码更改为UTF-8(使用记事本或其他使用另存为"的编辑器)时,此文件在输出中产生换行符.
At line 3 I included a PHP file named admin.inc.php
, this file contains only some functions and does not contain any HTML tag or any character outside <?php
and ?>
. When I change the file encoding to UTF-8 (with Notepad or other editors using save as) this file generates a line break in the output.
推荐答案
尝试将文件另存为UTF-8 without BOM
在Notepad ++的主菜单行中,有Encoding -> Convert to UTF-8 without BOM
in Notepad++ in the main menu row there is Encoding -> Convert to UTF-8 without BOM
这篇关于为什么Unicode PHP文件会生成换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文