1. function binhex($str) {
2. $hex = “”;
3. $i = 0;
4. do {
5. $hex .= sprintf(“%02x”, ord($str{$i}));
6. $i++;
7. } while ($i < strlen($str));
8. return $hex;
9. }
已知非正常空白: \xc2\xa0 \xe3\x80\x80
参照http://lcweb2.loc.gov/diglib/codetables/9.4.html


