title: How can I write a PHP script that will grab the follower count in Twitter for a given user?
body: <p>All I want to do is get the Twitter follower count for a given user, say John Mayer. I want to store this value in a variable $testCount and that's it.  I'm not writing an application or anything with any other users (all the documentation seems to revolve around the assumption that other users will be doing this)</p>
  
  <p>The reason I'm storing the value is because in my PHP script, all I want to do is store this value in a mySQL table.  Storing the value isn't the problem, it's retrieving it from Twitter's API. The eventual goal is to run this script every day and have it get an updated count of John Mayer's followers.  </p>
  
  <p>I've looked at other stack overflow answers and tried J7mbo's 'TwitterAPIExchange' method. So far I have this:</p>
  
  <pre><code>require_once('TwitterAPIExchange.php');    // TwitterAPIExchange.php is in the same folder as the //script I am modifying
  
  $settings = array(
  'oauth_access_token' =&gt; " my token",
  'oauth_access_token_secret' =&gt; "my secret",
  'consumer_key' =&gt; "my consumer key",
  'consumer_secret' =&gt; "my consumer secret"
  );
  
  $url = 'https://api.twitter.com/1.1/users/show.json?screen_name=JohnMayer';
  $requestMethod = 'GET';
  $getfield = '?screen_name=JohnMayer';
  $twitter = new TwitterAPIExchange($settings);
  $follow_count=$twitter-&gt;setGetfield($getfield)
           -&gt;buildOauth($url, $requestMethod)
           -&gt;performRequest();
          $testCount = json_decode($follow_count, true);
  echo $testCount[0]['user']['followers_count'];
  </code></pre>
  
  <p>the Echo simply doesn't print anything.  I've been working at this for days and can't seem to figure out how to grab this one statistic using php.  Please someone help me adjust or alter my current script to achieve this seemingly simple goal.   </p>