Taufik Nur Rahmanda
Taufik Nur Rahmanda

Reputation: 1969

PHP - How to decode or parse emoji from unicode string?

In my PHP code, I receive user's emoji as this string "1f49c" from frontend app.

It should be as simple as echo "\u{1f49c}";, but my data is only this string: "1f49c"

How to parse it to 💜?

I've tried:

$emoji = "1f49c";
$reaction = "\u".$emoji;
json_decode("\"$reaction\"");

but it results: Ὁc not 💜

Upvotes: 0

Views: 23

Answers (0)

Related Questions