日期:2014-05-17 浏览次数:20422 次
$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); }