xn_json_encode($arg)
对变量进行 JSON 编码,不对中文进行 UNICODE 转义。
$s:字符串
<?php include "./xiunophp/xiunophp.php"; $arr = array ("name"=>"中文"); $s = xn_json_encode($arr); echo $s; // 结果: {"name": "中文"} ?>