city($clientip); sendJsonResp(null, "OK", [ "location" => [ "latitude" => $record->location->latitude, "longitude" => $record->location->longitude ], "clientip" => $clientip, "postcode" => $record->postal->code, "attribution" => "This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com." ]); } catch (GeoIp2\Exception\AddressNotFoundException $ex) { sendJsonResp("Location not found for IP address.", "ERROR", ["clientip" => $clientip]); }