title: Do i need to apply htmlspecialchars / htmlentites on json array?
body: <p>I wanted to ask that in a php script of mine which I am accessing through an ajax request, I am returning json data ( converted from an array ) as such</p>
  
  <pre><code> echo json_encode($row_array);
  </code></pre>
  
  <p>I get this data in jquery and display it in a form. Do i need to apply htmlspecialchars /  htmlentites before returning the data?</p>
  
  <p>Is do then whats the correct way to do it? The following code gives me an error:</p>
  
  <pre><code>echo htmlentities(json_encode($row_array));
  </code></pre>
  
  <p>Thanking you
  Imran</p>