0
我生成這樣的數組。我怎樣才能訪問返回的主體?我有一個循環來獲取數據值來接收這個列表構建。我知道如何獲得totalResults,但我無法在陣列中獲得更深入的信息。謝謝。從多維數組檢索數據
foreach ($searchres as $videout){
echo '<li id="cNa9dzezrd8"><img src="http://i.ytimg.com/vi/cNa9dzezrd8/0.jpg"><br>';
echo '<div class="description">';
echo '<h3>Danny McCarthy - Silver Scrape...</h3>';
echo '<span>Author : </span> Kavvson<br>';
echo '<span>Views : </span> 161654<br>';
echo '</div></li>';
}
陣列
array(4) {
["totalResults"]=>
string(3) "588"
["startIndex"]=>
string(1) "1"
["itemsPerPage"]=>
string(1) "2"
["results"]=>
array(2) {
[0]=>
array(12) {
["id"]=>
string(11) "cNa9dzezrd8"
["title"]=>
string(67) "Danny McCarthy - Silver Scrapes (Extended culineR & Kavvson Edit)"
["description"]=>
string(160) "SoundCloud : Original version : Danny McCarthy - Silver Scrapes Edited by culineR and Me {} culineR www.Facebook.com/devonculineR www.Sou..."
["uploaded"]=>
string(19) "04/05/2013 00:20:51"
["duration"]=>
string(3) "274"
["author"]=>
string(8) "kavvsona"
["category"]=>
string(5) "Music"
["url"]=>
string(71) "http://www.youtube.com/watch?v=cNa9dzezrd8&feature=youtube_gdata_player"
["rating"]=>
string(8) "4.973549"
["views"]=>
string(6) "161654"
["comments"]=>
string(3) "147"
["thumbnails"]=>
array(4) {
[0]=>
string(39) "http://i.ytimg.com/vi/cNa9dzezrd8/0.jpg"
[1]=>
string(39) "http://i.ytimg.com/vi/cNa9dzezrd8/1.jpg"
[2]=>
string(39) "http://i.ytimg.com/vi/cNa9dzezrd8/2.jpg"
[3]=>
string(39) "http://i.ytimg.com/vi/cNa9dzezrd8/3.jpg"
}
}
沒錯這有助於相當。 – user3002600