title: Output HTML in JSON string generated by PHP
body: <p>I have some PHP that outputs json.</p>
  
  <pre><code>&lt;?php
  $html = utf8_encode($gegevens['tekst']);
  $html = htmlentities($html);
  //$html = htmlspecialchars($gegevens['tekst'], ENT_QUOTES, 'UTF-8');
  echo json_encode(array( 'titel' =&gt; $gegevens['titel'], 'html' =&gt; $html ));
  ?&gt;
  </code></pre>
  
  <p>The output will be like:</p>
  
  <pre><code>{"titel":"Here comes the title","html":"&lt;strong&gt;Here is the HTML&lt;\/strong&gt;\n&lt;br \/&gt;\n&lt;br \/&gt;\n     And some more."}
  </code></pre>
  
  <p>And the jQuery/Ajax will be:</p>
  
  <pre><code>$.ajax({
                              type: "GET",
                              url: "content/popup.php?id=" + id2,
                              dataType: 'json',
                              crossDomain: true,
                              success: function(json) {
                              var titel = json['titel'];
                              var html = json['html'];
  
  
  function ContentTonen()
  {
                                  // Div's legen van content
  $('.popup_home_head_inside').empty();
  $('.popup_home_content_inside').empty();
  
  $('.popup_home_head_inside').html(titel);
  var html2 = html.replace(/\"/g, "");
  //$('.popup_home_content_inside').html(html2);
  $('.popup_home_content_inside').html(html2);
  </code></pre>
  
  <p>And the HTML output is:</p>
  
  <pre><code>&lt;strong&gt;Some HTML&lt;/strong&gt; &lt;br /&gt; Some more text.
  </code></pre>
  
  <p>So it will not process as HTML.</p>
  
  <p>Can you help me out?</p>