定制 foolz/inet 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

foolz/inet

最新稳定版本:0.6.0

Composer 安装命令:

composer require foolz/inet

包简介

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

README 文档

README

This Composer package provides two functions that allow converting between IP Address and IP Decimal. It works for both IPv4 and IPv6.

Based on the answer to "How to convert IPv6 from binary for storage in MySQL?" on StackOverflow by Sander Marechal. Content posted on StackOverflow is under the CC BY-SA 3.0 License.

Requirements

Usage

$decimal_ip = \Foolz\Inet\Inet::ptod($ip);
$ip = \Foolz\Inet\Inet::dtop($decimal_ip);

Storage on MySQL Databases

You should use a DECIMAL(39,0) column to store the entire IP Decimal.

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: CC-BY-SA-3.0
  • 更新时间: 2012-09-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固