json 的key没有双引号的解决方法 2018-07-10 14:55:02 来自于分类 服务端 PHP function json_decode($str, $assoc=false){ if(preg_match('/\w:/', $str)){ $str = preg_replace('/(\w+):/is', '"$1":', $str); } return json_decode($str, $assoc); }