I have a user submitted IP address with netmask, and I need to make sure it is valid. For instance, if the user submits: 10.113.0.0/14, I need to flag it as invalid, because the /14 block for that IP range begins with 10.112.0.0.
How can I do this in PHP?
the function cidrMatch at the bottom of http://framework.zend.com/svn/framework/extras/incubator/library/ZendX/Whois/Adapter/Cidr.php should do what you want