title: Php 7 - Transform unicode string into a unicode char #emoji
body: <p>I am trying to make a little program in Php that get a message from a text file (json) and to convert some parts into emojis.</p>
  
  <p>The thing is, I just began php yesterday and since, I didn't find the solution to make it works...</p>
  
  <p>I have this code : </p>
  
  <pre><code>$message = $_GET["message"];
  $emojis = array();
  echo "{$message}\n";
  preg_match("({[A-Z0-9]+})", $message, $emojis);
  foreach($emojis as $key =&gt; $value) {
      echo "{$key} =&gt; {$value}\n";
      $emoji_string = "\\u".$value;
      $emoji_unicode = utf8_encode($emoji_string);
      $message = str_replace($value, $emoji_unicode, $message);
  }
  echo "{$message}\n";
  </code></pre>
  
  <p>So what I am trying to achieve is, by using this regex <code>(\\u{[A-Z0-9]+})</code>, created on <a href="https://regex101.com/" rel="nofollow noreferrer">Regex101</a>, I would like to transform a simple unicode text into a emoji in order to display a beautiful message haha</p>
  
  <p>So far, I understand that <code>\u{270B}</code> <a href="https://emojipedia.org/raised-hand/" rel="nofollow noreferrer">#RaisedHand</a> is only one char at the end, so that's why I try to convert my string into a simple char. Am I wrong? However, the code is wrong since I have <code>"\\u{270B}"</code> instead of <code>"\u{270B}"</code>...</p>
  
  <p>I am really out of idea for the moment about that, any idea on your side?</p>
  
  <p>Thanks for any help !</p>
  
  <p>Max</p>
  
  <h1>Edit 1</h1>
  
  <p>I tried with this message: <strong>Hey what's up? {270B}</strong></p>
  
  <p>output:</p>
  
  <pre><code>PHP
  debug start
  Hey what's up? {270B}
  0 =&gt; {270B}
  Hey what's up? \u{270B}
  debug done
  </code></pre>