1. //方法一:
    2. function unicode_decode($str) {
    3. //Unicode解码 linux UCS-2BE,windows UCS-2LE
    4. $t = preg_replace("#\\\u([0-9a-f]{4})#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $str);
    5. return $t;
    6. }
    7. //方法二:
    8. function unicode_decode($name){
    9. $json = '{"str":"'.$name.'"}';
    10. $arr = json_decode($json,true);
    11. if(empty($arr)) return '';
    12. return $arr['str'];
    13. }
    14. $content = unicode_decode($_POST['content']);
    15. echo $content ;