title: Encoding trouble with Facebook/Twitter API Emojis
body: <p>I'm very new to PHP and I'm having some encoding issues with emojis in the Facebook/Twitter API</p>
  
  <p>The data comes in and I see emojis represented like so: \u2026</p>
  
  <p>after json_decode the emojis look like this: â€¦ </p>
  
  <p>and on my website they look like â€¦.</p>
  
  <p>I'd like to handle them properly so they can be visible on the website or worst case just strip them out.  I found an js emoji library that can help if I can get the emojis in the right format. <a href="https://github.com/iamcal/js-emoji" rel="nofollow">https://github.com/iamcal/js-emoji</a></p>
  
  <p>The twitter code looks like this:</p>
  
  <pre><code>            $options = array( CURLOPT_HTTPHEADER =&gt; array("Authorization: $auth"),
                            //CURLOPT_POSTFIELDS =&gt; $postfields,
                            CURLOPT_HEADER =&gt; false,
                            CURLOPT_URL =&gt; $url,
                            CURLOPT_RETURNTRANSFER =&gt; true,
                            CURLOPT_SSL_VERIFYPEER =&gt; false);
  
              $feed = curl_init();
          curl_setopt_array($feed, $options);
          $json = curl_exec($feed);
          curl_close($feed);
          $twitter_data = json_decode($json, true);
  </code></pre>
  
  <p>The facebook code looks like this:</p>
  
  <pre><code>        $requests = file_get_contents($request_url);
          $fb_response = json_decode($requests);
          $parseresponse = $fb_response-&gt;data;
          $fbpost = "";
          if (isset($parseresponse[0]-&gt;message))
          {
              $fbpost = $parseresponse[0]-&gt;message;
              $fbpost = str_replace("’", "'", $fbpost);
          }
  </code></pre>
  
  <p>After retrieving the API data, I'm saving the results to a mysql database and then displaying the posts from mysql to the website to avoid unnecessary API calls.</p>
  
  <p>How can I get the FB/Twitter API emojis to work with <a href="https://github.com/iamcal/js-emoji" rel="nofollow">https://github.com/iamcal/js-emoji</a> ?</p>