2017-06-08 14 views

答えて

1

は、コードサンプルです:cURLの経由

$json_data = file_get_contents("http://ddragon.leagueoflegends.com/cdn/6.24.1/data/en_US/profileicon.json"); 

$data = json_decode($json_data, true); 

$items = $data['data']; 

foreach($items as $item){ 
    // Here you can get $item['id'] and $item['image'] and echo or do what you want with that data 
} 
+0

、どうもありがとう私をたくさん助けました! –

+0

あなたは大歓迎です! – gghughunishvili

1

なぜ機能を使用しないでくださいjson_decodeこれは、データでオブジェクトを作成するのですか?このオブジェクトを反復処理できます。ここで

0

のデータのロード:

$data = json_decode($your_json_data, 1); 
foreach($data as $item) 
{ 
    var_dump($item); 
    //... 
} 
関連する問題