あなたはおそらく、物事を簡単にするために、このためにPHPのライブラリを使用してオフに最適ですリクエストhttps://github.com/andreyknupp/Twitter
<?php
spl_autoload_register (function ($class) {
require_once sprintf ('%s.php' , $class) ;
}) ;
$URL = 'https://api.twitter.com/1/users/search.json';
$Data = Array ('q' => 'Search') ;
$Authentication = new \Twitter\TwitterAuthentication();
$Authentication->setConsumerKey ('UExmB6GoxftjZqdngw');
$Authentication->setConsumerSecret ('1yUvMAnrFiu86vCdhwAqM5ZHsgXRVyNhRdUDxeo');
$Authentication->setAccessToken ('2660353-PjccZS0nO28zaV0xaxR2UBklZR0nkjjso2wmLa');
$Authentication->setAccessTokenSecret ('DWwLG3RFt1drU0qRc4PHu0wdlmVks08BDM');
$OAuth = new Twitter\TwitterOAuthentication($Authentication);
$OAuth->setSignatureURL ($URL . '?' . http_build_query ($Data , false , '&')) ;
$OAuth->setSignatureMethod('GET') ;
$curl = curl_init();
curl_setopt($curl , CURLOPT_URL , $URL . '?' . http_build_query ($Data , false , '&')) ;
curl_setopt($curl , CURLOPT_HEADER , false) ;
curl_setopt($curl , CURLOPT_HTTPHEADER , Array ($OAuth->buildAuthorization($Data))) ;
curl_setopt($curl , CURLOPT_RETURNTRANSFER , true) ;
curl_setopt($curl , CURLOPT_SSL_VERIFYPEER , false);
$response = json_decode (curl_exec ($curl)) ;
print_r ($response) ;