https://gist.github.com/BarryMode/432a7a1f9621e824...function htmlemoji($str) {
$emoji_pattern = "/\\x{1F469}\\x{200D}\\x{2764}\\x{FE0F}\\x{200D}\\x{1F48B}\\x{200D}\\x{1F469}|\\x{1F469}\\x{200D}\\x{2764}\\x
...
\\x{2696}|\\x{2695}|\\x{2694}|\\x{26C8}|\\x{26CF}|\\x{2709}|\\x{26F5}|\\x{2708}|\\x{2705}|\\x{2702}|\\x{26FD}|\\x{26FA}|\\x{26F9}|\\x{26F8}|\\x{26F7}|\\x{26F4}|\\x{26D1}|\\x{26F3}|\\x{26F2}|\\x{26F1}|\\x{26F0}|\\x{26EA}|\\x{26E9}|\\x{26D4}|\\x{26D3}|\\x{00A9}/u";
function entity($matches) { return '&#'.hexdec(bin2hex(mb_convert_encoding("$matches[0]", 'UTF-32', 'UTF-8'))).';'; }
return preg_replace_callback($emoji_pattern, 'entity', $str);
}
echo htmlemoji('Look It works! '); // Output: Look