getlocation($ip); if($arr){ return ['IP所在地'=>$arr['province'].$arr['city'], '运营商'=>$arr['area']]; }else{ throw new Exception('查无此IP数据'); } } }