title: Weird character at start of json content type
body: <p>I'm trying to return json content read from MySQL server. This is supposed to be easy but, there is a 'weird' character that keeps appearing at start of the content.</p>
  <p>I have two pages for returning content:</p>
  <ol>
  <li><p><a href="http://kcb433.sytes.net/as/test.php?json=true&amp;limit=6&amp;input=d" rel="nofollow noreferrer">kcb433.sytes.net/as/test.php?json=true&amp;limit=6&amp;input=d</a></p>
  <p>this test.php is from a script written by Timothy Groves, which converts an array to json output</p>
  </li>
  <li><p><a href="http://kcb433.sytes.net/k.php?k=4" rel="nofollow noreferrer">http://kcb433.sytes.net/k.php?k=4</a></p>
  <p>this one is supposed to do the same</p>
  </li>
  </ol>
  <p>I tried to validate it here <a href="http://jsonformatter.curiousconcept.com" rel="nofollow noreferrer">jsonformatter.curiousconcept.com</a> but just page 1 gets validated, page 2 says that it does not contain JSON data.</p>
  <p>If accessed directly both pages has no problems. Then what is the difference, why both don't get validated?</p>
  <p>Then I found this page <a href="http://jsonformat.com" rel="nofollow noreferrer">jsonformat.com</a> and tried the same thing. Page 1 was ok and page 2 wasn't but, surprisingly the data could be read. At a glance,</p>
  <pre><code>{&quot;a&quot;:&quot;b&quot;}
  </code></pre>
  <p>may look good but there is a character in front.</p>
  <p>According to a hex editor online, this is the value of the string above (instead of 9 values, there are 10):</p>
  <pre><code>-- 7B 22 61 22 3A 22 62  22 7D
  </code></pre>
  <p>The code to echo json in page 2 is:</p>
  <pre><code>header(&quot;Content-Type: application/json&quot;);
  echo &quot;{\&quot;a\&quot;:\&quot;b\&quot;}&quot;;
  </code></pre>