emoji_unified_to_html($bytes), 'unified'=>emoji_html_to_unified(emoji_unified_to_html($bytes)) ]; $list[] = $data; unset($data); } return array_chunk($list,$slicing,true); } public static function utf8_bytes($cp){ if ($cp > 0x10000){ # 4 bytes return chr(0xF0 | (($cp & 0x1C0000) >> 18)). chr(0x80 | (($cp & 0x3F000) >> 12)). chr(0x80 | (($cp & 0xFC0) >> 6)). chr(0x80 | ($cp & 0x3F)); }else if ($cp > 0x800){ # 3 bytes return chr(0xE0 | (($cp & 0xF000) >> 12)). chr(0x80 | (($cp & 0xFC0) >> 6)). chr(0x80 | ($cp & 0x3F)); }else if ($cp > 0x80){ # 2 bytes return chr(0xC0 | (($cp & 0x7C0) >> 6)). chr(0x80 | ($cp & 0x3F)); }else{ # 1 byte return chr($cp); } } }