时间:2021-07-01 10:21:17 帮助过:16人阅读
echo ip2long($strIp); //此时输出的-1233780736
echo '
';
echo bindec( decbin( ip2long( $strIp ) ) ); // 输出3061186560,与MySQL函数输出一致~
【注】:
number bindec ( string $binary_string ); //二进制转换为十进制
string decbin ( int $number ); //十进制转换为二进制
http://www.bkjia.com/PHPjc/327463.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/327463.htmlTechArticle【造成原因】:Because PHP's integer type is signed, and many IP addresses will result in negative integers. 【解决办法】:其官方手册中提到,可以“you need...