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

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -