json daha basit değil mi?
http://api.locatorhq.com/?user=aaaz2...34&format=json <?php
$ipaddress = $_SERVER['REMOTE_ADDR'];
$locationstr = @json_decode(file_get_contents("http://api.locatorhq.com/?user=aaaz2568&key=cb70014a000193e4a21f8c5d546128d7ce231dae&ip=".$ipaddress."&format=json"),1);
$ulkeler=array("TR"=>"http://tr.x.com","DE"=>"http://de.x.com");
echo $locationstr["countryCode"];
if($ulkeler[$locationstr["countryCode"]])
{
header("Location: ".$ulkeler[$locationstr["countryCode"]]);exit;
}
else
{
echo ":(";
}