Home  >  Article  >  Backend Development  >  php向数据库中安插ip地址,有必要在插入之前将ip地址整形化么?为了以后方便比对

php向数据库中安插ip地址,有必要在插入之前将ip地址整形化么?为了以后方便比对

WBOY
WBOYOriginal
2016-06-13 13:06:03832browse

php向数据库中插入ip地址,有必要在插入之前将ip地址整形化么?为了以后方便比对。
如题!

------解决方案--------------------
既然是 为了以后方便比对 那么当然需要
php 提供了 ip2long 和 long2ip
mysql 提供了 INET_ATON 和 INET_NTOA

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article: phprpc例证 Next article: 正则解决方法