Angel list API を使用してこのデータを取得し、このコードを介して解析しようとしています (試行された解析をプルスルーします)。
解析コードが正しく機能しておらず、何らかの理由で [id] の値を取得できません。私はjsonの深さを調べていて、それが問題かもしれないと思い、さまざまなアプローチを試みましたが、何も機能していないようです. ネストされた配列から個々の値を引き出すのを手伝ってくれる人はいますか?
$ch = curl_init($array_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
$data = curl_exec($ch);
curl_close($ch);
$response = json_decode($data);
print $response->{'name'};
echo "\n";
出力例
Array
(
[0] => Array
(
[id] => 79840
[pic] => https://s3.amazonaws.com/photos.angel.co/startups/i/79840-e351f55eea90356818e586ca3e547981-thumb_jpg.jpg?buster=1333248008
[url] => https://angel.co/joinastartup-org
[name] => JoinAStartup.org
[type] => Startup
)
[1] => Array
(
[id] => 121425
[pic] => https://s3.amazonaws.com/photos.angel.co/startups/i/121425-7cea796d5afc33877d68c633963ec8e9-thumb_jpg.jpg?buster=1353964843
[url] => https://angel.co/jointly
[name] => Jointly
[type] => Startup
)
[2] => Array
(
[id] => 76554
[pic] => https://s3.amazonaws.com/photos.angel.co/startups/i/76554-d227b51eac3509eeba4cced14186b782-thumb_jpg.jpg?buster=1347923043
[url] => https://angel.co/supportlocal
[name] => SupportLocal
[type] => Startup
)
[3] => Array
(
[id] => 30334
[pic] => https://s3.amazonaws.com/photos.angel.co/startups/i/30334-219f36ea273ef199c2aaf7b034554b90-thumb_jpg.jpg?buster=1326922125
[url] => https://angel.co/jointli
[name] => Jointli
[type] => Startup
)
[4] => Array
(
[id] => 14278
[pic] => https://s3.amazonaws.com/photos.angel.co/startups/i/14278-8b9059bb1fa7fab5813dfbade19056eb-thumb_jpg.jpg?buster=1315736993
[url] => https://angel.co/joint
[name] => joint
[type] => Startup
)
[5] => Array
(
[id] => 22687
[pic] => https://s3.amazonaws.com/photos.angel.co/startups/i/22687-94e1104706736e7636d23ff055819b8c-thumb_jpg.jpg?buster=1337954356
[url] => https://angel.co/join-our-talents
[name] => Join Our Talents
[type] => Startup
)
[6] => Array
(
[id] => 45059
[pic] =>
[url] => https://angel.co/joint-research-centre
[name] => Joint Research Centre
[type] => Startup
)
[7] => Array
(
[id] => 119433
[pic] => https://s3.amazonaws.com/photos.angel.co/startups/i/119433-585159079dc0e8b31156e772d53914de-thumb_jpg.jpg?buster=1346721187
[url] => https://angel.co/joinspeaker-1
[name] => JoinSpeaker
[type] => Startup
)
[8] => Array
(
[id] => 40214
[pic] =>
[url] => https://angel.co/advanced-joining-technology
[name] => Advanced Joining Technology
[type] => Startup
)
[9] => Array
(
[id] => 35338
[pic] => https://s3.amazonaws.com/photos.angel.co/startups/i/35338-52ca618ccef71f1a67b21e2e838a4674-thumb_jpg.jpg?buster=1326845104
[url] => https://angel.co/joingo
[name] => Joingo
[type] => Startup
)
)