protected function getHexSequence($str)
	{
		$seq = [];
		$i   = 0;
		do
		{
			$cp = ord($str[$i]);
			if ($cp >= 0xF0)
			{
				$cp = ($cp << 18) + (ord($str[++$i]) << 12) + (ord($str[++$i]) << 6) + ord($str[++$i]) - 0x3C82080;
			}
			elseif ($cp >= 0xE0)
			{
				$cp = ($cp << 12) + (ord($str[++$i]) << 6) + ord($str[++$i]) - 0xE2080;
			}
			elseif ($cp >= 0xC0)
			{
				$cp = ($cp << 6) + ord($str[++$i]) - 0x3080;
			}
			$seq[] = sprintf('%04x', $cp);
		}
		while (++$i < strlen($str));

		return implode('-', $seq);
	}
protected function getHexSequence($str)
	{
		$seq = [];
		$i   = 0;
		do
		{
			$cp = ord($str[$i]);
			if ($cp >= 0xF0)
			{
				$cp = ($cp << 18) + (ord($str[++$i]) << 12) + (ord($str[++$i]) << 6) + ord($str[++$i]) - 0x3C82080;
			}
			elseif ($cp >= 0xE0)
			{
				$cp = ($cp << 12) + (ord($str[++$i]) << 6) + ord($str[++$i]) - 0xE2080;
			}
			elseif ($cp >= 0xC0)
			{
				$cp = ($cp << 6) + ord($str[++$i]) - 0x3080;
			}
			$seq[] = sprintf('%04x', $cp);
		}
		while (++$i < strlen($str));

		return implode('-', $seq);
	}
protected function getHexSequence ( $ str ) { $ seq = [ ] ; $ i = 0 ; do { $ cp = ord ( $ str [ $ i ] ) ; if ( $ cp >= 0xF0 ) { $ cp = ( $ cp << 18 ) + ( ord ( $ str [ ++ $ i ] ) << 12 ) + ( ord ( $ str [ ++ $ i ] ) << 6 ) + ord ( $ str [ ++ $ i ] ) - 0x3C82080 ; } elseif ( $ cp >= 0xE0 ) { $ cp = ( $ cp << 12 ) + ( ord ( $ str [ ++ $ i ] ) << 6 ) + ord ( $ str [ ++ $ i ] ) - 0xE2080 ; } elseif ( $ cp >= 0xC0 ) { $ cp = ( $ cp << 6 ) + ord ( $ str [ ++ $ i ] ) - 0x3080 ; } $ seq [ ] = sprintf ( '%04x' , $ cp ) ; } while ( ++ $ i < strlen ( $ str ) ) ; return implode ( '-' , $ seq ) ; }
Get the sequence of Unicode codepoints that corresponds to given emoji

@param  string $str UTF-8 emoji
@return string      Codepoint sequence, e.g. "0023-20e3"
Get the sequence of Unicode codepoints that corresponds to given emoji