PHP处理JSON字符串key缺乏双引号的解决方法

function ext_json_decode($str, $mode=false){ if(preg_match('/\w:/', $str)){ $str = preg_replace('/(\w+):/is', '"$1":', $str); } return json_decode($str, $mode); }
相关文章
相关标签/搜索