I use the below code to convert an emoji to unicode, but how do i apply this to a string without affecting the other text in string.
function emoji_to_unicode($emoji) {
$emoji = mb_convert_encoding($emoji, 'UTF-32', 'UTF-8');
$unicode = strtoupper(preg_replace("/^[0] /","U ",bin2hex($emoji)));
return $unicode;
}
$var = "