简体   繁体   English

php echo中多余的空格

[英]excess whitespace in php echo

I'm having an issue with my server's PHP echo function. 我的服务器的PHP echo函数有问题。

For some reason, everytime I call "echo", whatever echoes ends up with six or seven extra spaces in front of it, resulting in something like this: 出于某种原因,每当我称之为“回声”时,无论回声最终会在它前面有六或七个额外的空格,导致类似这样的事情:

echo "hello world"           //ends up like:
             hello world    //instead of:
     hello world

any ideas on what's happening? 关于发生了什么的任何想法?

it's happening across my ENTIRE server (weirdly, yesterday it worked fine. I didn't touch the php settings or anything) 它发生在我的整个服务器上(奇怪的是,昨天它运行正常。我没有触及php设置或任何东西)

here's just an example of a script that shows this error: 这里只是一个显示此错误的脚本示例:

posts URI to database 将URI发布到数据库

require_once("../../m/includes/globals.php");
$user = DB_Login($_POST["username"], $_POST["password"]);
$uri = mysql_escape_string($_POST["uri"]);
$userID = $user['userID'];
$result = DB_ExecuteQuery("UPDATE driver SET windowsPhoneID = '$uri' WHERE userID = '$userID'" );
if ($result === FALSE) { 
echo "error occurred during updating"; 
} 
echo "success!";

Do you have a closing php tag at the end of m/includes/globals.php? 你有m / includes / globals.php末尾的关闭php标签吗? Maybe there is some whitespace after the closing tag. 也许在结束标记之后有一些空白。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM