How can I convert \ud83d\ude1b to show emoji?
<p>I am using twemoji library to show emoticon image in Webpage.</p>

<p>I store codes like <code>"\ud83d\ude1b \ud83d\ude1b,hi"</code> within messages in my database, and now I need to display the corresponding emoji on my web page.</p>

<p>I am using PHP script to convert <code>"\u1F603"</code> to emoji:-,</p>

<pre><code>$text = "This is fun \u1f602! \u1f1e8 ";
$html = preg_replace("/\\\\u([0-9A-F]{2,5})/i", "&amp;#x$1;", $text);
echo $html;
</code></pre>

<p>Then I am using <a href="https://github.com/twitter/twemoji" rel="nofollow">twemoji</a> to parse the body and replace it with emoji icons:-</p>

<pre><code>window.onload = function() {

  // Set the size of the rendered Emojis
  // This can be set to 16x16, 36x36, or 72x72
  twemoji.size = '16x16';

  // Parse the document body and
  // insert &lt;img&gt; tags in place of Unicode Emojis
  codePoint = twemoji.convert.toCodePoint($('.com-text').html());
  twemoji.parse(document.body);

}
</code></pre>

<p>How can I convert <code>\ud83d\ude1b \ud83d\ude1b</code> in similar way using PHP for displaying emoji icons in a web page?</p>