![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Feb 2011
Location: Ontario, Canada
Posts: 1,026
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
frc
Industry Role:
Join Date: Jul 2003
Location: Bitcoin wallet
Posts: 4,663
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
|
cool that was easier than I thought, thanks guys
|
![]() |
![]() ![]() ![]() ![]() ![]() |