问题
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" ?>
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.
回答1:
Try to resave your file as UTF-8 without BOM
in Notepad++ in the main menu row there is Encoding -> Convert to UTF-8 without BOM
回答2:
Make sure there are no lines or even blank spaces before or after the php tags.
来源:https://stackoverflow.com/questions/13892722/why-does-a-unicode-php-file-generate-a-line-break