时间:2021-07-01 10:21:17 帮助过:30人阅读
$s = <<< JSON {name: "brandId1", type: "String1"} JSON; print_r(ex_json_decode($s)); function ex_json_decode($s, $mode=false) { if(preg_match('/\w:/', $s)) $s = preg_replace('/(\w+):/is', '"$1":', $s); return json_decode($s, $mode); }