title: (PHP) Simple HTML DOM parser: HTML symbols
body: <p>I'm trying to get usernames from <a href="http://www.foody.vn/ha-noi/sumo-bbq-hoang-quoc-viet" rel="nofollow noreferrer">this website</a> and this is what I've done:</p>
  
  <pre><code>$div = $html-&gt;find('div[class=micro-home-recent-review review-item]');
  for ($i=0; $i&lt;count($div); $i++){  
       $username = $div[$i]-&gt;find('div[class=tooltip-fullname]', 0)-&gt;find('b', 0)-&gt;plaintext;
       // I've tried using iconv but apparently it doesn't work
       $username = iconv(mb_detect_encoding($username), "UTF-8", $username); 
       $query = "INSERT INTO users ('name') VALUES ($username)";
       $pdo-&gt;query($query);
  }
  </code></pre>
  
  <p>Then the newly inserted records in my database are:</p>
  
  <p><img src="https://i.stack.imgur.com/kpIj3.png" alt="database records"></p>
  
  <p>As you can see, most of the names are recorded with HTML symbols, which can be displayed normally on browsers, but get messed up when shown as JSON. The same problem happens when I tried to get reviews, and below is the sample JSON of a review:</p>
  
  <p><img src="https://i.stack.imgur.com/B6Pux.png" alt="enter image description here"></p>
  
  <p>I need the JSON to show data in my Android app, therefore this problem needs to be solved or the data won't be displayed properly. What could be a possible solution for this? I really need your help and suggestions.</p>