downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

geoip_country_code_by_name> <Funciones de GeoIP
Last updated: Fri, 20 May 2011

view this page in

geoip_continent_code_by_name

(PECL geoip >= 1.0.3)

geoip_continent_code_by_nameObtiene la abreviación de dos letras del continente

Descripción

string geoip_continent_code_by_name ( string $hostname )

La función geoip_continent_code_by_name() devolverá la abreviación de dos letras del continente que corresponde al nombre de sitio web o una dirección IP.

Parámetros

hostname

El nombre del sitio web o dirección IP cuya localización quiere ser obtenida.

Valores devueltos

Devuelve una abreviación de dos letras del nombre del continente en caso de éxito, o FALSE si la dirección no puede encontrarse en la base de datos.

Ejemplos

Example #1 Un ejemplo de geoip_continent_code_by_name()

Mostrará donde el sitio web example.com está localizado.

<?php
$continent 
geoip_continent_code_by_name('www.example.com');
if (
$continent) {
    echo 
'Este sitio web está localizado en: ' $continent;
}
?>

El resultado del ejemplo sería:

 Este sitio web está localizado en: NA

Ver también



add a note add a note User Contributed Notes geoip_continent_code_by_name
fabien dot snauwaert at gmail dot com 19-Jan-2010 12:40
The return values are not really documented anywhere in a straight-forward fashion.

The best I could find is a list of all countries and their associated continent codes, here: http://www.maxmind.com/app/country_continent

Leaving us with 7 possible continents:

AS for Asia
EU for Europe
SA for South America
AF for Africa
AN for µAntartica
OC for Oceania
NA for North America

As mentioned above, if the host/IP is not found in the database, the function returns FALSE.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites