json - get profile picture from instagram api -
i'm trying profile pictures using instagram api. tried following code:
function getpho($userid) { $userid = "000000"; $token = "my access token"; $url = "https://api.instagram.com/v1/users/".$userid."/?access_token=".$token; $get = file_get_contents($url); $json = json_decode($get); foreach($json->data $user) { return $user->profile_picture; } } echo getpho($userid); but returns blank page. wrong code?
try
$json = json_decode($get); return $json->data->profile_picture;
Comments
Post a Comment