php中json中unicode转中文

preg_replace(“#\\\u([0-9a-f]+)#ie”, “iconv(‘UCS-2′,’UTF-8′, pack(‘H4′, ‘\\1′))”, $str)

第一个参数是取出所有的unicode码,

pack(‘H4′, ‘\\1′):Pack given arguments into binary string according to format.

H4:Hex string, high nibble first