<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 22 May 2013 21:54:29 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: Subnet validation with Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/15716</guid>
      <link>http://www.phpdeveloper.org/news/15716</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has a new post to his blog today looking at a method for <a href="http://www.eschrade.com/page/subnet-validation-with-zend-framework-4d2b3c84">validating subnets with the Zend Framework</a> using the Zend_Validate component.
</p>
<blockquote>
I saw on a <a href="http://stackoverflow.com/questions/4647553/zend-validate-between-with-ip2long/4648775#4648775">StackOverflow posting</a>, 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.
</blockquote>
<p>
The code for the validator is included - an extension of the Zend_Validator class that using the <a href="http://php.net/ip2long">ip2long</a> 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.
</p>]]></description>
      <pubDate>Tue, 11 Jan 2011 08:20:03 -0600</pubDate>
    </item>
  </channel>
</rss>
