2013-10-08 52 views
-4
Array (
    [items] => Array (
     [0] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwbkg0RkdLZ0lpbzA&export=download 
      [title] => 08. Devil Fish Dumpling.mp3 
     ) 
     [1] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwckVzMXFwNDJTN3c&export=download 
      [title] => 06. electro peaceful.mp3 
     ) 
     [2] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwQWVlSHRiRDV0RVU&export=download 
      [title] => 02. FRIENDSHIP.mp3 
     ) 
     [3] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwbURlQ3U2VUFuSWs&export=download 
      [title] => 03. polygon.mp3 
     ) 
     [4] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwLXVGM1dKV1BjUDA&export=download 
      [title] => 10. HEAVENLY MOON.mp3 
     ) 
     [5] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwSWo1N2NtR2FDTHc&export=download 
      [title] => 13 Far east nightbird.mp3 
     ) 
     [6] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwWUJMbXJ0V2JsanM&export=download 
      [title] => 01 - Connect.mp3 
     ) 
     [7] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwQ0lVYndpRXlpRnM&export=download 
      [title] => 02 Don\\\'t cry.mp3 
     ) 
     [8] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwMVl3WHRVenB4akE&export=download 
      [title] => 01 nexus.mp3 
     ) 
     [9] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwZVdmQnBXX1pnTEE&export=download 
      [title] => 1-02 SEED.mp3 
     ) 
     [10] => Array (
      [webContentLink] => https://docs.google.com/uc?id=0B-8ZjfWGsMOwNTZHTHV4TjYzZHM&export=download 
      [title] => 1-01 Follow me.mp3 
     ) 
    ) 
) 

我需要解析這個數組。PHP幫我解析數組

+1

爲什麼你無法解析它?它已經看起來很好解析給我。 – h2ooooooo

+2

你想用這個數組做什麼?..?你已經嘗試過什麼......? –

+0

請閱讀常見問題,然後嘗試重新格式化您的問題。 – pduersteler

回答

0
$links = array(); 
$titles = array(); 
foreach ($arr['items'] as $key => $item) 
{ 
$links[$key] = $item['webContentLink']; 
$titles[$key] = $item['title']; 
} 
for ($counter=0; $counter<count($links);$counter++) 
{ 
echo 'The song has link: '.$links[$counter].'<br />Title: '.$titles[$counter]; 
} 

陣列鏈接冠軍將有你需要的所有信息。

+0

它停止第一個數組。 [items] =>數組<這裏 – Mark

+0

我的意思是你把你的數組命名爲$ arr。 – AxelPAL