-5
我試圖剛剛在PHP中將MediaUrl
(意思就是URL)的值轉換爲帶有JSON的字符串數組。我想忽略其他一切。以下是我撥打的URL返回的內容。我需要在PHP中做些什麼才能將這些值存入數組?如何解析PHP中的這個JSON?
{
"d": {
"results": [
{
"__metadata":
{
"uri": "https://api.datamarket.azure.com/Data.ashx/Bing/Search/Image?Query='12 monkeys blu-ray'&$skip=0&$top=1",
"type": "ImageResult"
},
"MediaUrl": "http://www.dvdlink.ca/images/Movies%20Covers/9779/47/1250724527_1250911533.jpg",
"Thumbnail": {
"__metadata": {
"type": "Bing.Thumbnail"
},
"MediaUrl": "http://ts4.mm.bing.net/th?id=HN.607991009242185763&pid=15.1",
"FileSize": "10424"
}
},
{
"__metadata": {
"uri": "https://api.datamarket.azure.com/Data.ashx/Bing/Search/Image?Query='12 monkeys blu-ray'&$skip=1&$top=1",
"type": "ImageResult"
},
"MediaUrl": "http://www.bluray-dvd-film-shop.at/media/images/popup/12-Monkeys-bluray.jpg",
"Thumbnail": {
"__metadata": {
"type": "Bing.Thumbnail"
},
"MediaUrl": "http://ts4.mm.bing.net/th?id=HN.608017534956014467&pid=15.1",
"FileSize": "17060"
}
}
],
"__next": "https://api.datamarket.azure.com/Data.ashx/Bing/Search/Image?Query='12%20monkeys%20blu-ray'&$skip=50"
}
}
你知道如何解析PHP中的json。你知道如何訪問PHP中的數據結構 - >'json_decode'你的數據,發出'var_dump',然後做你的事情。 – moonwave99