function to_unicode($string) { spa
$str = mb_convert_encoding($string, 'UCS-2', 'UTF-8');code
$arrstr = str_split($str, 2); unicode
$unistr = ''; string
foreach ($arrstr as $n) {it
$dec = hexdec(bin2hex($n)); io
$unistr .= '&#' . $dec . ';'; function
}class
return $unistr;foreach
}coding