Let’s look up hex2bin function in php manual.
hex2bin
It says “Decodes hexadecimally encoded binary string”.
Example 1
mb_internal_encoding('UTF-8'); $char = 'あ'; echo bin2hex($char);
result: e38182
This is the unicode standard manual
Unicode.org
UTF8 has 1byte to 4 byte characters.
What happen about in the case of Emoji?
🌸 Cherry blossom: 1F338
mb_internal_encoding('UTF-8'); $char = '🌸'; echo bin2hex($char);
f09f8cb8
A number different from unicode was displayed.
Comversion seems to be done without problems.