要获得一个真正干净的 json 字符串,请使用以下三个常量,例如
<?php
$array = ['€', 'http://example.com/some/cool/page', '337'];
$bad = json_encode($array);
$good = json_encode($array, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
// $bad 为 ["\u20ac","http:\/\/example.com\/some\/cool\/page","337"]
// $good 为 ["€","http://example.com/some/cool/page",337]
?>