| 
 例子,php json_encode中文转码、乱码问题。
  // 防止json中文转码 - function jsonEncodeWithCN($data) {
 -     return preg_replace("/\\\u([0-9a-f]{4})/ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '$1'))", json_encode($data));
 - }
 $arr = array('a'=>'测试', b=>'hello'); echo jsonEncodeWithCN($arr); 
  |