PHP Geo IP Location : 확장설치
PHP에서 Geo IP Location 관련 함수를 사용하기 위해서는 Geo IP Location 모듈을 확장 설치 해야 한다. Geo IP 함수를 이용하면, 아이피 주소를 통하여 접속한 아이피의 지역 정보를 찾을 수 있다.
설치는 간단히 yum install GeoIP-devel 명령을 통해 설치 할 수 있고, /etc/php.ini에서 extension=geoip.so에 대하여 활성화만 해주면 된다.
자세한 내용은 PHP 공식사이트에서 확인 바란다.
http://docs.php.net/manual/en/intro.geoip.php
The GeoIP extension allows you to find the location of an IP address. City, State, Country, Longitude, Latitude, and other information as all, such as ISP and connection type can be obtained with the help of GeoIP.
- GEOIP 관련 함수
geoip_continent_code_by_name: Get the two letter continent codegeoip_country_code_by_name: Get the two letter country codegeoip_country_code3_by_name: Get the three letter country codegeoip_country_name_by_name: Get the full country namegeoip_database_info: Get GeoIP Database informationgeoip_db_avail: Determine if GeoIP Database is availablegeoip_db_filename: Returns the filename of the corresponding GeoIP Databasegeoip_db_get_all_info: Returns detailed information about all GeoIP database typesgeoip_id_by_name: Get the Internet connection typegeoip_isp_by_name: Get the Internet Service Provider (ISP) namegeoip_org_by_name: Get the organization namegeoip_record_by_name: Returns the detailed City information found in the GeoIP Databasegeoip_region_by_name: Get the country code and regiongeoip_region_name_by_code: Returns the region name for some country and region code combogeoip_time_zone_by_country_and_region: Returns the time zone for some country and region code combo
이 저작물은 크리에이티브 커먼즈 저작자표시-비영리-동일조건변경허락 4.0 국제 라이선스 에 따라 이용할 수 있습니다.
Comments
Related Posts
`strtotime`에선 `-1 months` 또는 `1 month ago`는 30일 이전이 아니다.
PHP에서 함수를 참으로 많이 사용한다. 날짜를 계산 할 때 이보다 편한 건 없기 때문이라고 할까나. 그런데 오늘 중요한 사실을 알았다. 머 이전부터 매뉴얼에는 나와 있었지만…
PHP : mysql_real_escape_string()
PHP에서 SQL Injection 공격 등을 방어하기 위하여 특수 문자열을 이스케이프 하기 위한 함수이다. 함수를 호출하면 와 같은 문자 앞에 (역슬레시)를 붙여서 해당 문…
Image Mime Type for PHP
PHP에서 사용되는 Image Type에 대한 매직넘버와 타입명 입니다. 공통으로 사용되는 Mine Type과 매핑하여 테이블로 정리 하였습니다. {:caption="PHP Ima…