php: ip2long dönen negatif val

0 Cevap php
function ip_address_to_number($IPaddress) { 
 if(!$IPaddress) {
  return false;
 } else {
  $ips = split('\.',$IPaddress);
  return($ips[3] + $ips[2]*256 + $ips[1]*65536 + $ips[0]*16777216);
 }
}

bu işlevi php birlikte işlev ip2long olarak aynı kodu çalıştırır. ben bu 2 değerlerini yazdırmak, ancak, ben 2 farklı döner olsun. neden? (Bir wamp çevreye php 5.2.10 kullanarak im).

ip2long ('200 .117.248.17 '); / / Döndürür -931792879

ip_address_to_number ('200 .117.248.17 '); / / Döndürür 3363174417

Applied and continued here: http://stackoverflow.com/questions/3063192/php-showing-my-country-based-on-my-ip-mysql-optimized

0 Cevap