<?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>Tue, 21 May 2013 13:08:12 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen's Blog: Validating UK Postcodes]]></title>
      <guid>http://www.phpdeveloper.org/news/15433</guid>
      <link>http://www.phpdeveloper.org/news/15433</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has <a href="http://akrabat.com/zend-framework/validating-uk-postcodes/">shared a bit of code</a> he's put together to help with validating UK postal codes (since the functionality in Zend_Validate doesn't <a href="http://unicode.org/cldr/trac/ticket/2600">cooperate</a>), so he extended the main Zend_Validate_PostCode with his own validator.
</p>
<blockquote>
It's easy enough to add a filter to remove the space, but I'm a little worried that when (and if) it gets fixed, will the fixed version Zend_Validate_PostCode then fail to validate postcodes without the space? In theory it should as the space is part of the spec. I'd hate my code to unexpectedly break due to a valid bug fix. I can easy work around this worry though by simply creating my own extension of Zend_Validate_PostCode.
</blockquote>
<p>
The thirty-five line code example allows you to correctly validate the postal code with a quick call to the "isValid" method. He also links to <a href="https://github.com/gargoyle/PmcLib/blob/master/Postcode/Validate.php">another method</a> from <i>Paul Court</i> to handle things similarly.
</p>]]></description>
      <pubDate>Mon, 15 Nov 2010 12:29:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: PHP and Ordnance Survey Mapping]]></title>
      <guid>http://www.phpdeveloper.org/news/14427</guid>
      <link>http://www.phpdeveloper.org/news/14427</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i>, indulging his "map geek" side, has written up a new post showing how he took the data from <a href="http://www.ordnancesurvey.co.uk/oswebsite/opendata/">Ordnance Survey</a> and <a href="http://derickrethans.nl/php-mapping.html">mapped some information in the UK</a> - postcode density for the whole area.
</p>
<blockquote>
I decided to map all the postcodes onto the UK map where more postcodes for a specific place would create a "lighter" colour. Each postcode has on average about 15 addresses, so in more densely populated areas you have more "postcodes-per-area". Doing this wasn't very difficult and it resulted in the <a href="http://derickrethans.nl/images/content/postcode-uk-scaled.jpg">following map</a>.
</blockquote>
<p>
He walks through the entire process including how, in working with the data, he noticed alignment issues caused by the differing projections the map information service uses (<a href="http://en.wikipedia.org/wiki/Mercator_projection">Mercator</a>) versus just mapping to a flat image. Some calculations were made to convert the latitude/longitude to the correct locations and the resulting points were plotted on a cut-out image of the UK.
</p>
<blockquote>
After I figured out all the maths for this, the only problem that remains that implementing those algorithms in PHP is show-calculating all the positions from the 1.6 million postcode locations takes up to 10 minutes. This is why I am not presenting any code yet. I am planning to implement all the necessary calculations in a <a href="http://derickrethans.nl/available-for-php-extension-writing.html">PHP extension</a> to speed up the calculations.
</blockquote>]]></description>
      <pubDate>Wed, 28 Apr 2010 10:55:14 -0500</pubDate>
    </item>
  </channel>
</rss>
