All Projects → TIM168 → Ip

TIM168 / Ip

Licence: other
🌏根据IpV4、IpV6地址获取定位信息的PHP🐘组件 PHP components that obtain location information based on IpV4, IpV6 addresses

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Ip

Geolocate-IP-Browser-Extension
A browser extension, which shows you the origin of your IP address.
Stars: ✭ 21 (-8.7%)
Mutual labels:  ipv6, ipv4, ip, ipv4-address
Ship
A simple, handy network addressing multitool with plenty of features
Stars: ✭ 81 (+252.17%)
Mutual labels:  ipv6, ipv4, ip
ipv6calc
ipv6calc
Stars: ✭ 33 (+43.48%)
Mutual labels:  ipv6, ipv4, ipv4-address
Aggregator
A stand-alone class implementation of the IPv4+IPv6 IP+CIDR aggregator from CIDRAM.
Stars: ✭ 19 (-17.39%)
Mutual labels:  ipv6, ipv4, ip
swift-ipify
Swift library for checking your IP address from ipify.org
Stars: ✭ 37 (+60.87%)
Mutual labels:  ipv4, ip, ipv4-address
geoip
🌚 🌍 🌝 GeoIP 规则文件加强版,同时支持定制 V2Ray dat 格式路由规则文件 geoip.dat 和 MaxMind mmdb 格式文件 Country.mmdb。Enhanced edition of GeoIP files for V2Ray, Xray-core, Trojan-Go, Clash and Leaf, with replaced CN IPv4 CIDR available from ipip.net, appended CIDR lists and more.
Stars: ✭ 524 (+2178.26%)
Mutual labels:  ipv6, ipv4, ipv4-address
bacnet-stack
BACnet Protocol Stack library provides a BACnet application layer, network layer and media access (MAC) layer communications services.
Stars: ✭ 199 (+765.22%)
Mutual labels:  ipv6, ipv4, ip
freebind
IPv4 and IPv6 address rate limiting evasion tool
Stars: ✭ 88 (+282.61%)
Mutual labels:  ipv6, ipv4, ipv4-address
IPpy
🚀 Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.
Stars: ✭ 54 (+134.78%)
Mutual labels:  ipv6, ipv4, ip
private-ip
Check if IP address is private.
Stars: ✭ 26 (+13.04%)
Mutual labels:  ipv6, ipv4, ip
Php Ip Tools
Useful tools for IP manipulations
Stars: ✭ 152 (+560.87%)
Mutual labels:  ipv6, ipv4, ip
captcp
A open source program for TCP analysis of PCAP files
Stars: ✭ 110 (+378.26%)
Mutual labels:  ipv6, ipv4, ip
Iptools
PHP Library for manipulating network addresses (IPv4 and IPv6)
Stars: ✭ 163 (+608.7%)
Mutual labels:  ipv6, ipv4, ip
go-external-ip
a Golang library to get your external ip from multiple services
Stars: ✭ 55 (+139.13%)
Mutual labels:  ipv6, ipv4, ip
ip
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.
Stars: ✭ 212 (+821.74%)
Mutual labels:  ipv6, ipv4, ip
python-iptools
A few useful functions and objects for manipulating ip addresses in python.
Stars: ✭ 68 (+195.65%)
Mutual labels:  ipv6, ipv4
php-ip-anonymizer
IP address anonymizer library for PHP
Stars: ✭ 55 (+139.13%)
Mutual labels:  ipv6, ipv4
PHP-IPAddress
IP Address utility classes for PHP
Stars: ✭ 63 (+173.91%)
Mutual labels:  ipv6, ipv4
ipv6
IPv6-adresse.dk source & data
Stars: ✭ 27 (+17.39%)
Mutual labels:  ipv6, ipv4
ip2location-nginx
Nginx module that allows user to lookup for geolocation information using IP2Location database.
Stars: ✭ 33 (+43.48%)
Mutual labels:  ipv6, ipv4

Ip

根据IpV4、IpV6地址获取定位信息的PHP组件

Build Status Latest Stable Version License Latest Unstable Version Total Downloads composer.lock

README: 中文/English

安装

$ composer require tim168/ip

使用

require __DIR__ .'/vendor/autoload.php';

use Tim168\Ip\Ip;

支持的语言格式

字符集 描述
en 英语
de 德语
es 西班牙语
pt-BR 葡语
fr 法语
ja 日语
zh-CN 中文
ru 俄语

获取Ip定位信息

$res = Ip::getIp('json','116.234.222.36')

示例

{
	"status": "success", //状态success或fail
	"country": "中国",   //国家
	"countryCode": "CN", //国家代码
	"region": "SH",      //省份简称
	"regionName": "上海",//省份
	"city": "上海",	   //城市
	"zip": "",           //邮编
	"lat": 31.0449,      //纬度
	"lon": 121.4012,	 //经度
	"timezone": "Asia/Shanghai", //时区
	"isp": "China Telecom (Group)", //运营商
	"org": "Chinanet SH",  //组织
	"as": "AS4812 China Telecom (Group)", //BGP机房
	"query": "116.234.222.36" //ip
}

获取XML格式

$res = Ip::getIp('xml','116.234.222.36')

示例

<?xml version="1.0" encoding="UTF-8"?>
<query>
	<status>success</status>
	<country>中国</country>
	<countryCode>CN</countryCode>
	<region>SH</region>
	<regionName>上海</regionName>
	<city>上海</city>
	<zip></zip>
	<lat>31.0449</lat>
	<lon>121.4012</lon>
	<timezone>Asia/Shanghai</timezone>
	<isp>China Telecom (Group)</isp>
	<org>Chinanet SH</org>
	<as>AS4812 China Telecom (Group)</as>
	<query>116.234.222.36</query>
</query>

获取CSV格式

$res = Ip::getIp('csv','116.234.222.36')

示例

success,中国,CN,SH,上海,上海,,31.0449,121.4012,Asia/Shanghai,China Telecom (Group),Chinanet SH,AS4812 China Telecom
(Group),116.234.222.36

获取序列化格式

$res = Ip::getIp('php','116.234.222.36')

示例

a:14:{s:6:"status";s:7:"success";s:7:"country";s:6:"中国";s:11:"countryCode";s:2:"CN";s:6:"region";s:2:"SH";s:10:"regionName";s:6:"上海";s:4:"city";s:6:"上海";s:3:"zip";s:0:"";s:3:"lat";d:31.0449;s:3:"lon";d:121.4012;s:8:"timezone";s:13:"Asia/Shanghai";s:3:"isp";s:21:"China
Telecom (Group)";s:3:"org";s:11:"Chinanet SH";s:2:"as";s:28:"AS4812 China Telecom
(Group)";s:5:"query";s:14:"116.234.222.36";}

IpV4转换成IpV6

$res = Ip::IpV4toV6('116.234.222.36')

示例

0000:0000:0000:0000:0000:ffff:74ea:de24

IpV6转换成IpV4

$res = Ip::IpV6toV4('0000:0000:0000:0000:0000:ffff:74ea:de24')

示例

116.234.222.36

License

MIT

后语

欢迎Star

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].