Instagram API:从JSON中获取整数


Instagram API : Get Integer from JSON

使用此代码,我可以得到ID很好,但我不知道如何获得数组的整数部分,例如follows值:

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

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" } }

如何构造这一行以获得后面的整数值?

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