(PECL geoip >= 1.0.3)
geoip_continent_code_by_name — ��ȡ�ߴ��Ĵ�д��ĸ���
$hostname
) : stringgeoip_continent_code_by_name() �������᷵����������IP��ַ���Ӧ���ߴ���д��ĸ��ơ�
hostname��Ҫ��λ��������IP��ַ��
�ɹ�������������д��ĸ��ɵ��ߴ�����ַ���, ��������ݿ���δ�ҵ������Ϣ�� FALSE ��
| Code | ���� |
|---|---|
| AF | ���� |
| AN | �ϼ��� |
| AS | ���� |
| EU | ŷ�� |
| NA | ������ |
| OC | ������ |
| SA | ������ |
Example #1 geoip_continent_code_by_name() ������ʹ�÷�����
���´��뽫���ӡ example.com �Ķ�λ��Ϣ��
<?php
$continent = geoip_continent_code_by_name('www.example.com');
if ($continent) {
echo 'This host is located in: ' . $continent;
}
?>
�������̻������
This host is located in: NA