0
Instagramからユーザープロファイルの画像を抽出しようとしていますが、必要な配列echo
を正常に管理できません。cURL JSONから配列を正しく抽出するには?
$url="https://www.instagram.com/selenagomez/media/";
// Initiate curl
$ch = curl_init();
// Disable SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
// Execute
$json=curl_exec($ch);
// Closing
curl_close($ch);
$result = json_decode($json, true);
echo $result[0]["profile-picture"];
私が取得しています:Notice: Undefined offset: 0 in test.php on line 23
はまた、第二JSONパラメータ(true
)を除外しようとしましたが、それは助けにはなりませんでした。次のように
ありがとうございました! – Ricardo