时间:2021-07-01 10:21:17 帮助过:74人阅读
$content = '{"a":"\u4e2d\u6587\u540d\u79f0","b":"\u6d4b\u8bd5\u7a0b\u5e8f\u3002"}';
$json = json_decode($content, true);
echo '';
echo $json['a'].'
'; //中文名称
echo $json['b']; // 测试程序。
New Document
o = {"a":"\u4e2d\u6587\u540d\u79f0","b":"\u6d4b\u8bd5\u7a0b\u5e8f\u3002"};作为 js 字符串
alert(o.a)
s = '{"a":"\u4e2d\u6587\u540d\u79f0","b":"\u6d4b\u8bd5\u7a0b\u5e8f\u3002"}';按 php 对象访问
o = eval(s);
alert(o.a)
$s = '{"a":"\u4e2d\u6587\u540d\u79f0","b":"\u6d4b\u8bd5\u7a0b\u5e8f\u3002"} ';按 php 数组访问
$o = json_decode($s);
echo $o->a;
$s = '{"a":"\u4e2d\u6587\u540d\u79f0","b":"\u6d4b\u8bd5\u7a0b\u5e8f\u3002"} ';
$a = json_decode($s, true);
echo $a['a'];