I'm relatively new to PHP and I started messing with a site. And I found the following code that was giving error:
<?php
function ip_details() {
$json = file_get_contents("http://ipinfo.io/");
$details = json_decode($json);
return $details;
}
$details = ip_details();
$ip = $details->ip;//34
$local = $details->city; //35
?>
This is the error that appears to me:
A PHP error was encountered Severilty: Notice Message: trying to get property of non-object Filename: views / login_view.php Line Number: 34
I know something about PHP but I did not understand what I was looking for here, but I did not find anything that would make me understand what that code was.
Does anyone notice this code that I can explain?