iksaku
$zwj = "\u{200D}";
// Reference, may come from 'foreach' loop
$short_code = ':family_man_woman_girl_boy:';
$url = 'https://github.githubassets.com/images/icons/emoji/unicode/1f468-1f469-1f467-1f466.png?v8';
if (preg_match('/^((?!unicode).)*$/', $url)) {
// Custom Github emoji
return;
}
preg_match('/(?<=\/)[a-zA-Z0-9\-]+(?=\.png)/', $url, $matches);
$parts = array_map(
fn (string $part) => mb_chr(hexdec($part)),
explode('-', $matches[0])
);
$unicode = implode($zwj, $parts);
echo $unicode;
๐จโ๐ฉโ๐งโ๐ฆ