我的服务器的 PHP echo 函数有问题。
出于某种原因,每次我调用“echo”时,无论什么 echo 都会在它前面多出六到七个空格,结果是这样的:
echo "hello world" //ends up like:
hello world //instead of:
hello world
对正在发生的事情有什么想法吗?
它发生在我的整个服务器上(奇怪的是,昨天它运行良好。我没有触及 php 设置或任何东西)
这只是显示此错误的脚本示例:
将 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!";
最佳答案
在 m/includes/globals.php 的末尾是否有结束 php 标记?结束标记后可能有一些空格。
关于php - php echo 中多余的空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11892646/