$ip = explode('.',IPADDRESS); $ipaddress = 16777216 * $ip[0] + 65536 * $ip[1] + 256 * $ip[2] + $ip[3];