im getting this two errors: Notice: Trying to get property 'users' of non-object in /Applications/MAMP/htdocs/ig_stats/jsontest.php on line 5
Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/ig_stats/jsontest.php on line 5
Im trying:
$json = json_decode(file_get_contents('https://www.instagram.com/web/search/topsearch/?query=lol'));
foreach($json->users as $item)
{
if($item->user->username == "lol")
{
echo $item->full_name;
}
}
All i want is to get the data in 'full_name' from the 'user' 'lol'. But i dont know how i can search for it :/
Can someone give me a hint or a solution?