title: Getting Twitter followers with JSON in PHP?
body: <p>I can get Tweets of users quite easily using PHP and JSON, but as soon as I use it to get a list of followers, I get errors. Both use JSON to return the values.</p>
  
  <p>The code is:</p>
  
  <pre><code>$jsonurl = "https://api.twitter.com/1/followers/ids.json?cursor=-1&amp;screen_name=mooinooicat";
  $contents = file_get_contents($jsonurl);
  $results = json_decode($contents, true);
  
  echo "&lt;pre&gt;";
  print_r($results);
  echo "&lt;/pre&gt;";
  </code></pre>
  
  <p>This gives me the following array:</p>
  
  <pre><code>Array
  (
      [next_cursor] =&gt; 0
      [ids] =&gt; Array
          (
              [0] =&gt; 31085924
              [1] =&gt; 53633023
              [2] =&gt; 18263583
          )
  
      [previous_cursor] =&gt; 0
      [next_cursor_str] =&gt; 0
      [previous_cursor_str] =&gt; 0
  )
  </code></pre>
  
  <p>How do I get the values of next_cursor and previous_cursor and how do I loop just through the ids array? </p>
  
  <p>I want to parse the results for reading into a database.</p>