这是json格式:
{
"Album": [
{
"name": "despacito",
"lang": "spanish",
"thumbnail": "some-url",
"scrn":"some-url",
"ourl":"some-url",
"YearOfRelease": 2017
}
]
}
如何在WordPress网站上显示此JSON。如果有任何教程,请分享或尝试帮助我这样做。
答案 0 :(得分:0)
使用PHP 使用 json_decode($ obj)解码json对象 参考:Decoding json in php
{
"Album": [
{
"name": "despacito",
"lang": "spanish",
"thumbnail": "some-url",
"scrn":"some-url",
"ourl":"some-url",
"YearOfRelease": 2017
}
]
}
检索名称,使用 $ obj->相册 - >名称
foreach($obj-> Album as $value){
echo $value->name; //change accordingly
}
资料来源:json_decode to array