Hello my fellow coders!
So I'm pulling down a user's tweet steam in JSON format via PHP. I'd like to decode it into an associative array or at least some more usable fashion rather than a string so that I can maneuver through it.
I've been reading like mad about json_decode, but for me it seems like when I use it, before and after, the contents of the file is still being detected as one long string. Can anyone help me figure out what I am doing wrong?
$url = "http://twitter.com/status/user_timeline/" . $username . ".json?count=" . $count . "&callback=?";
// $url becomes "http://twitter.com/status/user_timeline/steph_Rose.json?count=5&callback=?";
$contents = file_get_contents($url);
$results = json_decode($contents, true);
echo "<pre>";
print_r($results);
echo "</pre>";
echo gettype($results); // this returns string