<?
$ip = '95.79.1.36'; //russian ip for test
$str = 'http://ipgeobase.ru:7020/geo?ip='.$ip;
$content = file_get_contents($str);
preg_match_all('#<country>(.*)(</country>)#Usi', $content, $matches);
$country = $matches[0][0];
preg_match_all('#<city>(.*)(</city>)#Usi', $content, $matches);
$city = $matches[0][0];
if($country == 'RU'){
echo 'City: '.$city.'';
}else{
echo 'Country: '.$country.'';
}
?>
The problem is $country == 'RU' , not work, my question is why ?
Thanks )))