没有双引号的JSON格式,有什么办法用PHP解开吗 没有双引号的JSON格式,有什么办法用PHP解开吗。格式如:{name: "brandId1", type: "String1"}json的标准格式应该是key有双引号,目前第三方数据无引号,请问有什么办法可以解开为数组吗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $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);}stdClass Object( [name] => brandId1 [type] => String1)判别算法不够完备,请自行完善 sourceforge.net改版了 如何上传文件 交换链接 ? 寻求帮忙,拟把一段js代码的改成php代码 php 源码限制问题 php动态生成的表格,读取特定列的值,列里面是文本框或者下拉框,要求读取文本框的值和下拉框当前显示的值,请问怎么做啊? PHP 与 AJAX 的问题 iframe弹出页面, 所有session丢失 小日历php程序 求教高手怎么用花生壳2.0+wordpress搭建个人网站?急~~~在线 php post到C#的接口文件上面,为什么穿过去的是空? PHP 获取值! PHP的时间戳让JS显示,显示不正确!
{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);
}stdClass Object
(
[name] => brandId1
[type] => String1
)判别算法不够完备,请自行完善