Download the PHP package tim168/ip without Composer

On this page you can find all versions of the php package tim168/ip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ip

Ip

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

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

README: 中文/English

安装

使用

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


All versions of ip with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version ^6.5
phpunit/phpunit Version ~5
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tim168/ip contains the following files

Loading the files please wait ....