0

I have tried many code snippets here at stackoverflow without success.

I am looking for a php function to convert -

"This is a smiley "%uD83D%uDE0B" 

to  

"This is a smiley "

Here is a working example of what I am trying to achieve.

http://www.online-toolz.com/tools/text-unicode-entities-convertor.php

Under: Decode/Unescape Unicode Entities

Arsh Dhillon
  • 101
  • 1
  • 9

1 Answers1

3

this may be one way to work around your %u syntax

$emoji = '%uD83D%uDE0B';
print 'This is my emoji: '. json_decode('"' . str_replace('%', '\\', $emoji) . '"');

base on Print Unicode characters PHP

arhak
  • 2,488
  • 1
  • 24
  • 38