php - Instagram API : Get Integer from JSON -


this question has answer here:

using code can id fine, can't figure out how integer part of array, example follows value:

$result = file_get_contents("https://api.instagram.com/v1/users/1234/?access_token={token}"); $obj = json_decode($result); echo $obj->data->id; 

instagram json example:

object(stdclass)#1 (2) { ["meta"]=> object(stdclass)#2 (1) { ["code"]=> int(200) } ["data"]=> object(stdclass)#3 (7) { ["username"]=> string(6) "testy" ["bio"]=> string(51) "blah blah" ["website"]=> string(26) "http://domain.com" ["profile_picture"]=> string(110) "https://scontent.cdninstagram.com/hphotos-xfa1/some.jpg" ["full_name"]=> string(16) "my testy" ["counts"]=> object(stdclass)#4 (3) { ["media"]=> int(141) ["followed_by"]=> int(23900) ["follows"]=> int(184) } ["id"]=> string(4) "1234" } }

how construct line follows integer value?

echo $obj->data->follows; 

echo $obj->data->counts->follows; 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -