$audience = array("date"=>"2018-04-18 08:05:50", "ip"=>"198.7.31.23", "visit"=>"Returned User"); $ip_addr = $audience["ip"]; require_once 'vendor/autoload.php'; use GeoIp2\Database\Reader; $reader = new Reader('GeoLite2-City.mmdb'); $record = json_decode(json_encode($reader->city($ip_addr))); $continent = $record->continent->names->en; $contry = $record->country->names->en; $city = $record->city->names->en; $audience = $audience + array('continent'=>$continent, 'contry'=>$contry, 'city'=>$city); print_r("<pre>"); var_dump($audience); print_r("</pre>");
きた!