I am getting NULL for all my JSON data here is my code
$jsons1 = file_get_contents($api_url); // returns JSON
$jsons=json_decode($jsons1);
foreach ($jsons as $json)
{
echo "
";
echo "<ul>";
echo "<li>";
echo "
Title : ".$json->title."
";
echo "
Content: ".$json->content."
";
echo "</li>";
echo "</ul>";
}
I am unable to fetch it like $json->title, Am i missing something?
The output is
- Title : Content:
Please help in this regard
here is output of $jsons1
variable
{"results":[{"title": "Temp, Russia - Wikipedia, the free encyclopedia","kwic": "Coordinates : 52°03′N 39°44′E  /  52.05°N 39.733°E  / 52.05; 39.733 tenmp ( Russian : УÑмань ) is a town and the administrative center of ...","content": "","url": "http://en.wikipedia.org/wiki/sdfds,_Russia","iurl": "","domain": "en.wikipedia.org","author": "","news": false,"votes": "1","date": 1357744155518,"related":[]}],"query": "tenp","suggestions":[],"count":96,"start":1,"length":10,"time": "412"}