is there any small and fast solution to bring an ip into an int format?
thx.
No, because an IP address is not an integer...
If you're asking if you can just get rid of the '.' then use str_replace()
just found it.
one-way-convertion is the solution.
$data = explode(".",$ip); $ip_num = ($data[0]*16777216) + ($data[1]*65536) + ($data[2]*256) + $data[3];
if you want faster selects from mysql convert your ips to an int.
...or you could just use [man]ip2long[/man]...