原来是需要把IP转成十进制
$ip = $_SERVER['REMOTE_ADDR'];
echo '你的IP:'.$ip.'
';
$ip_arr = explode(".",$ip);
$ip = 0;
foreach($ip_arr as $i=>$s){
$ip += $s*pow(256,3-$i);
}
echo '转十进制值:'.$ip.'
';
//结果你的IP:127.0.0.1
转十进制值:2130706433
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