PHPで文字列をバイト表現に変換するの履歴

bin2hex('あ');

unpack('C3','あ');

pack('H6',bin2hex('あ'));

http://code.nanigac.com/forum/view/55