title: displaying Japanese characters with php from database
body: <p>PHPMyAdmin is displaying Japanese characters perfectly with COLLATION =: utf8mb4_unicode_ci but it just displays ???? in the browser.</p>
  
  <p>I am using the correct UTF code in the HTML headers like: </p>
  
  <pre><code>&lt;meta content='text/html; charset=UTF-8' http-equiv='Content-Type'&gt;
  &lt;meta charset="UTF-8"&gt;
  </code></pre>
  
  <p>Here are the PHP code snippets:</p>
  
  <pre><code>`&lt;?php
  //Create connection credentials
  $db_host = 'localhost';
  $db_name = 'quizzer';
  $db_user = 'root';
  $db_pass = '';
  
  $mysqli = new mysqli ($db_host, $db_user, $db_pass, $db_name);
  
  if($mysqli-&gt;connect_error){
      printf("Connect failed: %s\n", $mysqli-&gt;connect_error);
      exit();
  }
  
  //Set question number
  $number = (int) $_GET['n'];
  
  /*
  *   Get total questions
  */
  $query = "SELECT * FROM `questions`";
  //Get result
  $results = $mysqli-&gt;query($query) or die($mysqli-&gt;error.__LINE__);
  $total = $results-&gt;num_rows;
  
  /*
  *   Get Question
  */
  $query = "SELECT * FROM `questions`
              WHERE question_number = $number";
  //Get result
  $result = $mysqli-&gt;query($query) or die($mysqli-&gt;error.__LINE__);
  
  $question = $result-&gt;fetch_assoc();
  
  /*
  *   Get Choices
  */
  $query = "SELECT * FROM `choices`
              WHERE question_number = $number";
  //Get results
  $choices = $mysqli-&gt;query($query) or die($mysqli-&gt;error.__LINE__);
  
  
  &lt;?php $question['question_number']; ?&gt; of &lt;?php echo $total; ?&gt;
  
  &lt;?php echo $question['text']; ?&gt;
  
  &lt;?php while($row = $choices-&gt;fetch_assoc()): ?&gt;
  
      &lt;?php echo $row['id']; ?&gt;" /&gt;&lt;?php echo $row['text']; ?&gt;
  
  &lt;?php endwhile; ?&gt;`
  </code></pre>