I'm using github's api to pull the most popular "starred" items under PHP, and it's pulling the json string ok. Only issue is my json_decode is still just dumping the JSON string and not an object. Below is the function I'm running.
private function fillTable(){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.github.com/search/repositories?q=+language:php&sort=stars&order=desc',
CURLOPT_USERAGENT => 'trickell'
));
$res = curl_exec($curl);
var_dump(json_decode($res));
}
I'm not exactly sure why it's not decoding the json string to an object. If you run this you should be able to see exactly what's pulling.