关于json json是一种数据格式, $json_str2 = preg_replace('/([,|{])s*(d+?)s*:/','$1"$2":', $match_result[1]); echo $json_str2;