PHP-Code:

                
if($json file_get_contents("https://geoip-db.com/jsonp/".$userip)){
                    
$data json_decode($json);

                    
$country_code $data->country_code;
                    
$country_name $data->country_name;
                }