![]() |
Need help with maxmind geo ip php script
I am really new to php and trying to figure this out so I can get better results for whatstheirip.com. I need to convert every IP address to an IP number to use the GeoIp script from maxmind. Here is their formula to convert it:
ipnum = 16777216*w + 65536*x + 256*y + z where IP Address = w.x.y.z So basically I need to convert an ip (lets use 24.24.24.24 as an example) to 4 different variables = w, x, y, z How do I do this? Ip address = $ip |
Sorry I am on my phone so can't give examples but you can use the explode function to accomplish this. Use the period as the delimiter, convert to array, echo each piece however you want.
http://php.net/manual/en/function.explode.php |
Quote:
|
cool that was easier than I thought, thanks guys
|
All times are GMT -7. The time now is 02:21 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123