title: htmlentities is not working with json encoding
body: <p>I don't know what is going on with this but htmlentities() function is not working!</p>
  
  <p>Here is what i have done</p>
  
  <p>(the bottom code work correctly but htmlentities() does not convert quotes to html code! for example " should be change to some html5 code!</p>
  
  <pre><code>$term = "'" . addslashes($_GET['search_term']) . "%'";
  if(!isset($term{2})){
      exit();
  }
  
  $query = $db-&gt;query('SELECT customerID, fullName, dID, birthYear, homeAddress, ID, DATE_FORMAT(idIssue, "%d-%m-%Y") AS idIssue, DATE_FORMAT(idExp, "%d-%m-%Y") AS idExp, phone
                       FROM customers WHERE (fullName LIKE '.$term.' ) LIMIT 0,10');
  
  
  
  while( $row = $query-&gt;fetch_assoc()){
  
      foreach($row as $key =&gt; $value){
          $arr[$key] = htmlentities(stripslashes($value), ENT_QUOTES);
      }
      $json[] = $arr;
  }
  
  echo json_encode($json);
  </code></pre>