2017 © Pedro Peláez
 

library ip-location-zh

get the ip's location info with Chinese

image

zhuzhichao/ip-location-zh

get the ip's location info with Chinese

  • Friday, January 5, 2018
  • by zhuzhichao
  • Repository
  • 17 Watchers
  • 313 Stars
  • 26,746 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 77 Forks
  • 2 Open issues
  • 27 Versions
  • 17 % Grown

The README.md

Ip Location Zh

Scrutinizer Code Quality Build Status Total Downloads Latest Stable Version License , (*1)

数据最后更新时间为 2019-7-3, 更新时间:不定期。 数据源于: http://www.ipip.net, (*2)

IPIP典型客户 ipip客户, (*3)

这是一个能够通过 Ip,获取该 IP 所在的位置,例如通过 ip:171.12.10.156 可以获得是 中国河南郑州,以及中国行政区划代码(支持到市级), 同样能获得国外的地址,但是没有国内详细。, (*4)

注意: 该免费数据库不提供经纬度、运营商、行政区等更详细的内容, 如果你有更多的需求可以考虑使用他们的收费服务。本包的目的是提供给需求简单, 手里没钱的程序员或者老板不舍得掏钱来获取定时更新的IP信息, (*5)

国家码和邮编不是该包负责的内容, 需自行构建相关的程序, (*6)

特点

  1. 不配置和使用数据库,妈妈再也不用担心配置问题了
  2. 使用简单,功能专(dān)注(yī)
  3. 使用 composer 进行安装管理,国际标准,方便快捷,即安即用,随时更新数据库

Install

这里不详细介绍安装 composer 了,大家根据 链接 自行安装吧!, (*7)

composer require "zhuzhichao/ip-location-zh", (*8)

Usage

Common

可以这样来用, (*9)

require 'vendor/autoload.php';


use Zhuzhichao\IpLocationZh\Ip;


var_dump(Ip::find('171.12.10.156'));
// 返回结果
array (size=4)
  0 => string '中国' (length=6)
  1 => string '河南' (length=6)
  2 => string '郑州' (length=6)
  3 => string '' (length=0)
  4 => string '410100' (length=6)

Laravel

对于laravel可以这样优雅的用:, (*10)

1.安装该插件, (*11)

2.在 config/app.php(Laravel 5.0 - 5.4)添加下面的代码,如果是 Laravel 5.5+ ,已经支持扩展包发现,不需要添加下面的代码, (*12)

// Laravel 5.5 不需要添加
'aliases' => [
    'Ip'  => 'Zhuzhichao\IpLocationZh\Ip',

],

3.然后开始在你的项目里面使用了 Ip::find('171.12.10.156')Ip::find(Request::getClientIp()), (*13)

对,很简单,只用一个方法,那就是 find, (*14)

Contributing

有什么新的想法和建议,欢迎提交 issue 或者 Pull Requests 。, (*15)

License

MIT, (*16)

The Versions

05/01 2018

dev-master

9999999-dev

get the ip's location info with Chinese

  Sources   Download

MIT

The Development Requires

by Avatar zhuzhichao

ip location chinese

05/01 2018

v2.4.1

2.4.1.0

get the ip's location info with Chinese

  Sources   Download

MIT

The Development Requires

by Avatar zhuzhichao

ip location chinese

19/10 2017

v2.4.0

2.4.0.0

get the ip's location info with Chinese

  Sources   Download

MIT

The Development Requires

by Avatar zhuzhichao

ip location chinese

20/09 2017

v2.3.2

2.3.2.0

get the ip's location info with Chinese

  Sources   Download

MIT

The Development Requires

by Avatar zhuzhichao

ip location chinese

27/08 2017

v2.3.1

2.3.1.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

27/08 2017

2.3.0

2.3.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

17/01 2017

v2.2.3

2.2.3.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

12/01 2017

v2.2.2

2.2.2.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

12/01 2017

2.2.1

2.2.1.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

09/01 2017

1.x-dev

1.9999999.9999999.9999999-dev

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

09/01 2017

v1.9.4

1.9.4.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

09/01 2017

2.2.0

2.2.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

09/01 2017

v1.9.3

1.9.3.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

04/06 2016

v1.9.2

1.9.2.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

04/06 2016

v2.1

2.1.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

29/04 2016

v2.0

2.0.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

29/04 2016

v1.9.1

1.9.1.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

01/04 2016

v1.9

1.9.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

18/12 2015

v1.8

1.8.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

04/11 2015

v1.7

1.7.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

04/08 2015

v1.6

1.6.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

02/06 2015

v1.5

1.5.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

09/04 2015

v1.4

1.4.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

02/02 2015

v1.3

1.3.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

05/12 2014

v1.2

1.2.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

10/10 2014

v1.1

1.1.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese

12/09 2014

v1.0

1.0.0.0

get the ip's true location with Chinese

  Sources   Download

MIT

by Avatar zhuzhichao

ip location chinese