Is it a valid IP?
function is_ip($text) { foreach (explode(".", $text) as $num) { if ($num > 255) return false; } return true; }
Although anything above 224.* and the private and loopback addresses are probably not useful, they're still IP'.
Rating: 5 / 5 (1 votes) 6036 views
Want to share your source code? Create your account and join our community!
Comments
Add your comment