简体   繁体   中英

excess whitespace in php echo

I'm having an issue with my server's PHP echo function.

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)

here's just an example of a script that shows this error:

posts URI to database

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? Maybe there is some whitespace after the closing tag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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