2013-06-30 3 views
1

PHP에서 JSON user_timeline 객체의 내용을 가져 오거나 구체적으로 반복 처리하려면 어떻게해야합니까? 내가 가져온 것은 개체의 필드에 액세스하려는 것뿐입니다. 다른 튜토리얼/해답은 새로운 1.1 API에는 적용되지 않습니다. 내가 어디 여기입니다 :PHP에서 JSON 객체 반복하기

$url = 'https://api.twitter.com/1.1/statuses/user_timeline.json'; 
    $getfield = '?screen_name=testyMcTesterton'; 
    $requestMethod = 'GET'; 

    $twitter = new TwitterAPIExchange($settings); 
    $twitter->setGetfield($getfield) 
     ->buildOauth($url, $requestMethod) 
     ->performRequest(); 

답변

0

당신이 도움이 될 개체 자체의 내용을 게시하는 경우,하지만 당신은 단지 json_decode($obj) 수 없다? 그것과 같은 작업을 수행합니다

실제로 트위터 user_timeline 객체가 내가 특별히 할 요소에 액세스하는 방법을 정확하게 말할 수 없다 보이는 방법을 알고하지 않습니다하지만, JSON 배열에 액세스하는 방법은
$new = json_decode($obj); 
$data = $new->data; // (this would access Object->data->*) 

.