looking4soul/ipgeo 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

looking4soul/ipgeo

Composer 安装命令:

composer require looking4soul/ipgeo

包简介

Find geo location of ip

关键字:

README 文档

README

#IpGeo

Find geo location of ip.

##Usage

###Install

composer install

###Set Up Redis

start up redis on 127.0.0.1:6379

###Download GeoLite2

http://dev.maxmind.com/geoip/geoip2/geolite2/

###Import Ip Geo Into Redis

<?php
require 'vendor/autoload.php';
$block = 'path/to/GeoLite2-City-Blocks-IPv4.csv';
$location = 'path/to/GeoLite2-City-Locations-zh-CN.csv';
$ipgeo = new \Looking4soul\IpGeo\IpGeo();
$ipgeo->import($block, $location);

###Search City by Ip

<?php
require 'vendor/autoload.php';
$ipgeo = new \Looking4soul\IpGeo\IpGeo();
var_dump($ipgeo->find_city_by_ip('140.237.24.176'));
/*expected output is array of city and country in zh-CN.
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(6) "中国"
}
*/

##License

The MIT License (MIT).

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固