- sprintf: documentation ( source)
- md5: documentation ( source)
- iconv: documentation ( source)
<?php
$str = '你好';
$input_encoding = 'GBK';
$str_gb = iconv('UTF-8', 'GBK', $str);
echo sprintf("gb encoding :%s\n", $str_gb);
echo sprintf("gb encoding md5:%s\n", md5($str_gb));