這是我 json_decode 對(duì)方回給我的 json 結(jié)果stdClass Object
(
[attributes] => Array
(
[0] => stdClass Object
(
[attribute-id] => 5c6186217d4d0765152e42f7
[attribute-type] => skill
[parent-attribute-id] =>
[parent-attribute-name] =>
[name] => rgargrereshserhersh
[slogan] => srehsrehrsehsrehre
[description] => hrehrehresserhgserhserh
[time-created] => 2019-02-11T14:54:57.073Z
[available] => 1
[time-available] => 2019-02-11T14:26:41.348Z
[image-path] => http://127.0.0.1:9002/images/attribute/icon/15498952015c61862103aea-icon.JPG
[cover-path] => http://127.0.0.1:9002/images/attribute/cover/15498952015c61862103aea-cover.jpg
)
)
)請(qǐng)問(wèn)我要怎麼印出 name?他第一層有 「attributes」我原本的做法是<?=$data->{'name'};?>但是不行??多了第一層的「attributes」讓我沒(méi)辦法印,如何印第二層的KEY?PS:只會(huì)有一筆,所以不會(huì)用 foreach
如何印 json_decode 第二層?
慕桂英3389331
2019-03-02 06:03:09