Find an IP address in a set (looking for a pro's advice)
I am looking to to store several sets of 'IP addresses ranges' (e.g: a.b.c.d to w.x.y.z) in a table. I would then like to take a given IP address and search MySQL to find whether the IP address exist in the database.
As of now, the best approach I can think of is to
- store the IP address ranges as regular expressions in the db
- php script grabs all regexes and stores in an array
- php scripts loops through each array entry, and checks for match
Is there a better way?
#define TRUE FALSE
//Happy debugging suckers
Bookmarks