- Three weeks of hard work and I'm finally moving out of this hole. >>
- RT @ChrisPirillo: Is it just me, or is Twitter Suggestions virtually useless? It's showing me "famous" people I've done my best to ignor ... >>
- Fantastic uygur restaurant near Shinjuku http://yfrog.com/m97dqj >>
- Forget the mouse and god damn trackpad, I want a magic trackball!!! >>
- RT @mamachari: Clash of cultures or mere insensitivity? English teacher gets in hot water for playing hangman in Jpn school http://bit.l ... >>
This is one of those strange things that sounds a lot easier to do than it is.
I originally handled this by exploding the character through this:
$array = preg_split('//u', $a);
This worked fine and the string was split into an array of unicode characters. The next part was converting it into a useful hexidecimal value.
$character = $array[0];
$value = hexdec(bin2hex($character));
I originally thought this was the way to do so – I was wrong, don’t do it. It turns out there is no real simple way to convert from UTF-8 to hex values. Instead, try the UTF8ToUnicode function here: http://hsivonen.iki.fi/php-utf8/
Include this function and use the author’s utf8ToUnicode function. It becomes simple then:
$value = utf8ToUnicode($character);
$value = $value[0];
I am only posting this because of the sheer amount of time it took for me to find this information. I hope it helps you out.
Comments (1)







