Menu
Folks,
I have defined the $country but I get error I have not.
Why ?
[code]
<?php
$two_letter_country_code=iptocountry(“101.102.103.104”);
function iptocountry($ip) {
$numbers = preg_split( “/./”, $ip);
include(“ip_files/”.$numbers[0].”.php”);
$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
foreach($ranges as $key => $value){
if($key<=$code){
if($ranges[$key][0]>=$code){$country=$ranges[$key][1];break;}
}
}
if ($country==””){$country=”unkown”;}
return $country;
}
?>
<?php
echo “$country”;
?>
Error on this line: echo “$country”;