musclehead Posted May 13, 2008 Share Posted May 13, 2008 My head is spinning trying to figure out the correct syntax to do a regex to validate an IP address. I'm dealing w/ a /16 class network, so I only need to worry about the last 2 segments of the IP address and ensure they are valid (0-254). I have a simple comparison against the first 2 segments, as they will always be the same, but I'm trying to get a regular expression to check the last 2 segments of the IP address to ensure they're valid. I'd post code I've tried, but it's a mess...so I'll spare everyone the horror. Thanks!!! Link to comment https://forums.phpfreaks.com/topic/105440-php-ip-address-validation/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.