📅  最后修改于: 2022-03-11 14:54:53.088000             🧑  作者: Mango
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
echo $details->city; // -> "Mountain View"