News Feed
Jobs Feed
Sections




News Archive
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

Internet.com: Storing Blobs in Microsoft Azure with the Zend Framework

PHP in Action Blog: Flash Messages

NetTuts.com: Easy Form Generation Using FuelPHP

DZone.com: Setting Up MongoDB on a Mac

Community News: PHP Tutorial Site - GoodPHPTutorials.com


Community Events











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


object development functional application code zendframework2 example interview opinion podcast introduction series language tool release community phpunit unittest framework testing

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