<?php
function test($in){
return strtoupper(bin2hex(iconv('UTF-8', 'UCS-2', $in)))."\n";
}
echo test('Sześć siedem');
echo test('Źdźbło');
echo test('String with no special chars');
----------
Results:
53007A0065005B0107012000730069006500640065006D00
790164007A01620042016F00
53007400720069006E0067002000770069007400680020006E006F0020007300700065006300690061006C00200063006800610072007300