title: HTML is NULL in JSON object from json_encode
body: <p>I have a ajax call calling a php file who runs a long php function which returns a JSON encoded array/object. Now I need to send HTML also into the ajax response. I thought about sending the HTML inside the array. </p>
  
  <p>Is that a good practise? </p>
  
  <p>Right now I cannot get it working, I get a <code>NULL</code> as value for that property. Don't know why.</p>
  
  <pre><code>$statHTML = '&lt;table&gt;';
  foreach ($toHTML as $key=&gt;$value) {
      $statHTML.= '
          &lt;tr class="'.$key.'"&gt;
              &lt;td class="side"&gt;'.$value[0].'&lt;/td&gt;
              &lt;td&gt;'.$value[2].' '.$value[1].'&lt;/td&gt;
          &lt;/tr&gt;';
  }
  $statHTML.= '&lt;/table&gt;';
  //  echo $statHTML;   // - this works
  //function return   
  $answer = array('mostSearched'=&gt;$mostSearched,
                  'timeOfDay' =&gt; $timeOfDay,
                  'mostSearchedDays'=&gt;$mostSearchedDays,
                  'statHTML' =&gt; $statHTML                 
              );
  return json_encode($answer);
  </code></pre>
  
  <p>The ajax response from the console before the <code>JSON.parse()</code>:</p>
  
  <pre><code>{
      "mostSearched": {
          "title": "Most serached houses",
          "colNames": [21],
          "rowNames": [2013],
          "rows": [1]
      },
      "timeOfDay": {
          "title": "Time of search",
          "colNames": ["07:30"],
          "rowNames": ["07:30"],
          "rows": [
              [1]
          ]
      },
      "mostSearchedDays": {
          "title": "Most searched days",
          "colNames": ["2013-12-21", "2013-12-22", "2013-12-23", "2013-12-24", "2013-12-25", "2013-12-26", "2013-12-27"],
          "rowNames": ["2013-12-21", "2013-12-22", "2013-12-23", "2013-12-24", "2013-12-25", "2013-12-26", "2013-12-27"],
          "rows": [
              [1, 1, 1, 1, 1, 1, 1]
          ]
      },
      "statHTML": null
  }
  </code></pre>