M
M
MrFavour2020-06-09 02:45:48
PHP
MrFavour, 2020-06-09 02:45:48

PHP Line with 16 code output as emoji unicode?

Good afternoon.
I've been scratching my head for days, rummaged through all the documentation, I can't find an answer.

There is a line in which the hexadecimal code is written.
And you need to use the variable to display it as emoji unicode

Here is the code:

$text = '1f9d2';
//Вот так смайл выводится:
echo "\u{1f9d2}";

//А через переменную не работает:
echo "\u{'$text'}"


And all my string conversions don't help.

Help pliz)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2020-06-09
@MrFavour

https://stackoverflow.com/a/6058533

A
Anton Shamanov, 2020-06-09
@SilenceOfWinter

Is the document encoding correct? and you need to write in uppercaseecho "\u{1F9D2}";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question