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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 10:57:10825Durchsuche

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

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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:请高手分析一上Nächster Artikel:PHP的fwrite会并发执行