javascript ajax php call returns with 3 more characters
<p>i have this php file (stripped down to the essential part)</p>

<p>getBoundaries.php</p>

<pre><code>&lt;?php
        $t = "";
        //$t = "t";

        Header("Content-type: text/plain; charset=utf-8");
        echo ($t);
 ?&gt;
</code></pre>

<p>and this javascript ajax call:</p>

<pre><code>function anyname(){
    var xhttp;
    var query = "tid=1&amp;pid=1";
    xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
        if (xhttp.readyState == 4 &amp;&amp; xhttp.status == 200) {
            var temp = xhttp.responseText;
            if (temp == ""){
                console.log("ein leerer string");
            }
            else{
                for (i = 0; i &lt; temp.length; i++){
                    console.log(temp.charCodeAt(i));
                }
            }
        }
    }
    xhttp.open("POST", "getBoundaries.php", true);
    xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhttp.send(query);
}
</code></pre>

<p>The output of <code>console.log</code> with <code>$t=""</code> were 32, 10, 32.</p>

<p>The output of <code>console.log</code> with <code>$t="t"</code> were 116, 32, 10, 32.</p>

<p>So, my question is: WHY isn't an empty string returned as responseText? Where are these additional 3 characters added? My assumption: the <code>echo</code> php-command adds those three chars.</p>

<p>Any suggestions?</p>