I have this code here:
<?php
$url = "http://otter.topsy.com/search.json?q=debt%20management&window=a";
$jsonfile = file_get_contents($url);
$obj = json_decode($jsonfile);
echo $obj->response[0]->list[0]->trackback_permalink;
?>
*Note: I have taken my API key out of the URL.
However, it returns this:
Notice: Trying to get property of non-object in C:\xampp\htdocs\topsyAPI\index.php on line 23
Notice: Trying to get property of non-object in C:\xampp\htdocs\topsyAPI\index.php on line 23
Notice: Trying to get property of non-object in C:\xampp\htdocs\topsyAPI\index.php on line 23
I tried using the true parameter on json_decode and it's still not working.
This is the first time i've worked with an API and JSON, so I am very much new to it.. Could someone help me out please?
responseisn't an array, its an object.