<?php
$ipadre = ipGetir();
?>
<?php
function ulke($ipadre) {
$ulke = file_get_contents("http://ipinfo.io/".$ipadre."/country");
return $ulke;

}
$ulke = ulke($ipadre);
if(preg_match('/TR/',$ulke)){
 
 header("Location:https://ytadd.com/?peslang=ro");
 
exit();
}else{
 
 header("Location:https://ytadd.com/?peslang=en");
 
exit();
}

?>
<?php } ?>
böyle bir şey kullanıyordum