News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Kevin Schroeder's Blog:
Subnet validation with Zend Framework
January 11, 2011 @ 08:20:03

Kevin Schroeder has a new post to his blog today looking at a method for validating subnets with the Zend Framework using the Zend_Validate component.

I saw on a StackOverflow posting, someone was asking to see how you could use a Zend Framework validator to tell if an IP address was between two addresses. The individual was trying to use Zend_Validate_Between to do the checking. [...] So, assuming that the individual was actually asking about subnet validation, and seeing that I couldn't find a subnet validator for Zend Framework, I wrote a quick one.

The code for the validator is included - an extension of the Zend_Validator class that using the ip2long function to determine the netmask from a given subnet and an "isValid" method to call for the check. There's also a unit test included that you can drop into your test suites.

0 comments voice your opinion now!
zendframework zenvalidate subnet netmask tutorial


blog comments powered by Disqus

Similar Posts

NETTUTS.com: Introducing WordPress 3 Custom Taxonomies

Stefan Mischook's Blog: PHP Classes and Objects video tutorial

MaltBlue.com: Zend Form Mastery with Zend_Config - Part 3, Standard Form & Element Options

Greg Freeman: Processing data with PHP using STDIN and Piping

Markus Wolff's Blog: Extending Zend_Controller_Action


Community Events





Don't see your event here?
Let us know!


community configure threedevsandamaybe project library application developer code framework bugfix wordpress podcast language introduction api laravel list release series interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework