Hi,
I’m making a code to take users using Twitter-API-PHP, but the return is always NULL.
Below is my code:
<?php
//Include the class file
require_once(‘TwitterAPIExchange.php’);
//Set access tokens
$settings = array(
‘oauth_access_token’ => “214180610-XXXXX”,
‘oauth_access_token_secret’ => “XXXXX”,
‘consumer_key’ => “XXXX”,
‘consumer_secret’ => “XXXXX”
);
//GET Request Example
$url = ‘https://api.twitter.com/1.1/users/search.json’;
$getfield = ‘?q=Danilo&page=1&count=1’;
$requestMethod = ‘GET’;
$twitter = new TwitterAPIExchange($settings);
$response = $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();
var_dump(json_decode($response));
?>
________________________________________
Are there something wrong? I tried put the codes examples, but all only return NULL.
What should I do?
Thanks.