yueyang
(yueyang)
金牌会员
 
高级会员
UID 20841
精华
1
积分 1420
帖子 1388
金钱 1410 喜悦币
威望 10
人脉 0
阅读权限 70
注册 2003-6-17
状态 离线
|
[广告]: Enom域名自助付费 自助注册 自助PUSH 主流域名COM等一律57.99元年
这样的JSON在PHP中如何应用?
{ "programmers": [
{ "firstName": "Brett", "lastName":"McLaughlin", "email": "brett@newInstance.com" },
{ "firstName": "Jason", "lastName":"Hunter", "email": "jason@servlets.com" },
{ "firstName": "Elliotte", "lastName":"Harold", "email": "elharo@macfaq.com" }
],
"authors": [
{ "firstName": "Isaac", "lastName": "Asimov", "genre": "science fiction" },
{ "firstName": "Tad", "lastName": "Williams", "genre": "fantasy" },
{ "firstName": "Frank", "lastName": "Peretti", "genre": "christian fiction" }
],
"musicians": [
{ "firstName": "Eric", "lastName": "Clapton", "instrument": "guitar" },
{ "firstName": "Sergei", "lastName": "Rachmaninoff", "instrument": "piano" }
]
}
已经得到$test如上
我知道$test->authors可以得到authors的值
但authors下的第一列firstName的值该如何取呢?
$test->authors->firstName 这样是不对的。
如何写才能得到正确的值呢?
|  我在HP官方论坛做版主希望大家能来捧场,论坛有礼品赠送及可兑换礼品. |
|