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);
}
}
эта функция выполняет тот же код, что и связанная с php функция ip2long. однако, когда я печатаю эти 2 значения, я получаю 2 разных результата. Зачем? (im использует php 5.2.10 в среде Wamp).
ip2long('200.117.248.17'); //returns **-931792879**
ip_address_to_number('200.117.248.17'); // returns **3363174417**
Применяется и продолжается здесь: Отображение моей страны на основе моего IP-адреса, оптимизированного mysql