> I think it'd be hard to verify the range with a regex. ip2long and long2ip
> do not validate. So, an option would be to write your own little function
> that splits the $ip on the period, verifies there are 4 parts, then checks
> that each part is between 1 and 255 inclusive.
My other post on the subject notwithstanding, I agree.
When I get time/when I get a round tuit, I'd like to do a performance test
on the (short) IP RegEx against what you have outlined:
explode against "."
run resultant array through 0-255 validation function
- and still have the semantic issues of 0.0.0.0, etc...
Meantime, will sit here whistling and quietly muttering into my beard (and
dreaming of tuits),
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php