J7mbo / twitter-api-php

The simplest PHP Wrapper for Twitter API v1.1 calls
MIT License
1.82k stars 802 forks source link

Using Underscore Hashtags in get field, ie: #india_india, Statues array return empty #275

Open kumarrishikesh12 opened 5 years ago

kumarrishikesh12 commented 5 years ago
<?php 
include("TwitterAPIExchange.php");

         $accesstoken = 'bla bla';
         $accesstokensecret =  'bla bla';
         $consumerkeyapikey =  'bla bla';
         $consumersecretapikey =   'bla bla';

$hashtags = '#india_india';
$url = 'https://api.twitter.com/1.1/search/tweets.json';
$getfield = '?q='.$hashtags.'&count=50'; //30hashtag post defined
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
$tweest_json = $twitter->setGetfield($getfield)->buildOauth($url,$requestMethod)->performRequest();
$tweets = json_decode($tweest_json, true);

echo $tweest_json;
die();

//it's showing me an blank array, 
//if i am using only single value with hash sign its showing me data. ie:  **$hashtags = '#india';**

?>