Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmedfaragmostafa/geoip
The Easiest Package to Get all information about an IP Address
https://github.com/ahmedfaragmostafa/geoip
php7
Last synced: about 1 month ago
JSON representation
The Easiest Package to Get all information about an IP Address
- Host: GitHub
- URL: https://github.com/ahmedfaragmostafa/geoip
- Owner: ahmedfaragmostafa
- Created: 2018-07-20T21:49:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-20T23:45:15.000Z (over 6 years ago)
- Last Synced: 2024-10-19T08:42:21.770Z (2 months ago)
- Topics: php7
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/ahmedfaragmostafa/geoIp.svg?branch=master)](https://travis-ci.org/ahmedfaragmostafa/geoIp) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/ahmedfaragmostafa/geoIp/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ahmedfaragmostafa/geoIp/) [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
## GEO IP
The Easiest way to Get all information about an IP Address using http://ip-api.com
## Install
```
composer require "ahmedfaragmostafa/geo-ip":"dev-master"
```## Get Stared
``` php
use \Src\GeoIp;
$ipInfo = new GeoIp('IP_ADDRESS');
```## Example
``` php
$ipInfo = new \Src\GeoIp('85.203.13.62');$ipInfo->getCountry(); //France
$ipInfo->getCountryCode(); //FR$ipInfo->getLon(); //2.3292
$ipInfo->getLat(); //48.8628$ipInfo->getCity(); //Paris
$ipInfo->getRegionName(); //Île-de-France
$ipInfo->getRegion(); //IDF$ipInfo->getZip(); // 75001
$ipInfo->getTimezone(); // Europe/Paris$ipInfo->getOrg(); //Falco Networks
```### Tests
vendor/bin/phpunit tests