나는 방문자가 중동에서 경우 감지 할 수있는 명확한 방법을 찾고 있어요. 그럴 경우 다른 헤더 이미지를 표시해야합니다 (현재 머리글에 돼지가 들어있어 눈살을 찌푸리게됩니다). 그 다음 다른 것을위한 경우PHP를 통해 중동 방문객을 어떻게 감지합니까?
은 내가 코딩 할 수 있지만, 난 그냥 감지하는 간단한 기능을 찾고 있어요. 다음은 IP로 국가를 얻는 데 사용한 기능입니다.
function get_country_by_ip($ip){
if(!$ip) return false; # Missing parameter
# Pull the XML
$url = 'http://api.hostip.info/?ip='.$ip;
$xml = simplexml_load_file($url);
# Parse the data and store into array
$citystate = explode(", ", $xml->children('gml', true)->featureMember->children()->Hostip->children('gml', true)->name);
$result['city'] = $citystate[0];
$result['state'] = $citystate[1];
$result['country'] = $xml->children('gml', true)->featureMember->children()->Hostip->countryName;
$result['country_abbr'] = $xml->children('gml', true)->featureMember->children()->Hostip->countryAbbrev;
return (object) $result;
}
아무도 도와 줄 수 있습니까? 감사.
당신이 무슨 문제 위의 나라가 있다면? - 또한이 국가에 대한 권리를 보장하지 않습니다 –
3 회 중동/N에 비해 아시아 - 태평양 지역의 많은 무슬림이 있습니다. 아프리카. 참조 [위키 피 디아 (http://en.wikipedia.org/wiki/List_of_countries_by_Muslim_population) –