CURL Instagram API。我的个人资料照片没有显示

时间:2019-11-06 22:13:38

标签: php html

php代码

<?php
      function get_CURL($url)
      {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        $result = curl_exec($curl);
        curl_close($curl);
        return json_decode($result, true);
      }
    $result = get_CURL('https://api.instagram.com/v1/users/self?access_token=XXXXXX.XX.XXXXb9344ace8f0953e8b');
    $usernameIG = $result['data']['username'];
    $profilePictureIG = $result['data']['profile_picture'];
    $followersIG = $result['data']['counts']['followed_by'];
?>

html

<img src="<?= $profilePictureIG; ?>" width="100" class="rounded-circle img-thumbnail">

0 个答案:

没有答案