<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Converting US State names into their Abbreviations (and back!)</title>
	<atom:link href="http://www.sean-barton.co.uk/2008/05/converting-us-state-names-into-their-appreviations-and-back/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sean-barton.co.uk/2008/05/converting-us-state-names-into-their-appreviations-and-back/</link>
	<description>by Sean Barton, a freelance PHP website developer in Crewe, Cheshire</description>
	<lastBuildDate>Tue, 07 Feb 2012 21:17:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: LeberMac</title>
		<link>http://www.sean-barton.co.uk/2008/05/converting-us-state-names-into-their-appreviations-and-back/comment-page-1/#comment-6150</link>
		<dc:creator>LeberMac</dc:creator>
		<pubDate>Fri, 07 Oct 2011 13:38:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=7#comment-6150</guid>
		<description>Sean, great PHP script, and useful!

I do a good bit of mailing work over here in the states, and I think I&#039;ll crib your PHP code and work something up. 

One note, you could also add 
Puerto Rico --&gt; PR
Guam --&gt; GU

And also - adding the Canadian province abbreviations would be super-useful, a lot of times when mailing we&#039;ll get some Canadian addresses thrown in there.

Thanks and keep rockin&#039; the code...</description>
		<content:encoded><![CDATA[<p>Sean, great PHP script, and useful!</p>
<p>I do a good bit of mailing work over here in the states, and I think I&#8217;ll crib your PHP code and work something up. </p>
<p>One note, you could also add<br />
Puerto Rico &#8211;&gt; PR<br />
Guam &#8211;&gt; GU</p>
<p>And also &#8211; adding the Canadian province abbreviations would be super-useful, a lot of times when mailing we&#8217;ll get some Canadian addresses thrown in there.</p>
<p>Thanks and keep rockin&#8217; the code&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.sean-barton.co.uk/2008/05/converting-us-state-names-into-their-appreviations-and-back/comment-page-1/#comment-4487</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Thu, 02 Dec 2010 14:41:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=7#comment-4487</guid>
		<description>Hi Jonah, not surely sure what you mean there but on revisiting my code I am being a little bit overeager with the case changes. Abbreviations will always be upper case so it doesn&#039;t need changing. The strtolowers on the name check are, however, relevant as remember half of the check is coming from an unknown source and needs to be sanitised.

The line $return = strtoupper($state[&#039;abbrev&#039;]); can just be $return = $state[&#039;abbrev&#039;]; if we were being fussy but ultimately it doesn&#039;t make a great deal of difference.

thanks
Sean</description>
		<content:encoded><![CDATA[<p>Hi Jonah, not surely sure what you mean there but on revisiting my code I am being a little bit overeager with the case changes. Abbreviations will always be upper case so it doesn&#8217;t need changing. The strtolowers on the name check are, however, relevant as remember half of the check is coming from an unknown source and needs to be sanitised.</p>
<p>The line $return = strtoupper($state['abbrev']); can just be $return = $state['abbrev']; if we were being fussy but ultimately it doesn&#8217;t make a great deal of difference.</p>
<p>thanks<br />
Sean</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwerre</title>
		<link>http://www.sean-barton.co.uk/2008/05/converting-us-state-names-into-their-appreviations-and-back/comment-page-1/#comment-4460</link>
		<dc:creator>jwerre</dc:creator>
		<pubDate>Wed, 01 Dec 2010 20:05:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=7#comment-4460</guid>
		<description>Thanks James, this is helpful. One suggestion:

  if ($state[&#039;name&#039;] == strtoupper($name)){
      $return = $state[&#039;abbrev&#039;];
      break;
  }

No need to change case to lower then uppper and then back again</description>
		<content:encoded><![CDATA[<p>Thanks James, this is helpful. One suggestion:</p>
<p>  if ($state['name'] == strtoupper($name)){<br />
      $return = $state['abbrev'];<br />
      break;<br />
  }</p>
<p>No need to change case to lower then uppper and then back again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.sean-barton.co.uk/2008/05/converting-us-state-names-into-their-appreviations-and-back/comment-page-1/#comment-2402</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Fri, 18 Jun 2010 16:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=7#comment-2402</guid>
		<description>Hi James, 

you are indeed correct. For some reason it worked at the time. Must have been either a fluke or me being negligent :) Sorted now though!

thanks
Sean</description>
		<content:encoded><![CDATA[<p>Hi James, </p>
<p>you are indeed correct. For some reason it worked at the time. Must have been either a fluke or me being negligent <img src='http://www.sean-barton.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Sorted now though!</p>
<p>thanks<br />
Sean</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.sean-barton.co.uk/2008/05/converting-us-state-names-into-their-appreviations-and-back/comment-page-1/#comment-2392</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 14 Jun 2010 17:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=7#comment-2392</guid>
		<description>Code works great and saved me a hassle. Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Code works great and saved me a hassle. Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://www.sean-barton.co.uk/2008/05/converting-us-state-names-into-their-appreviations-and-back/comment-page-1/#comment-2390</link>
		<dc:creator>James</dc:creator>
		<pubDate>Sun, 13 Jun 2010 13:10:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=7#comment-2390</guid>
		<description>The problem with the code is that there is a typo in the array. The second elementshould read &quot;abbrev&quot; and you have it reading &quot;apprev&quot;, so the function doesnt work. 

Best,

James</description>
		<content:encoded><![CDATA[<p>The problem with the code is that there is a typo in the array. The second elementshould read &#8220;abbrev&#8221; and you have it reading &#8220;apprev&#8221;, so the function doesnt work. </p>
<p>Best,</p>
<p>James</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 9/23 queries in 0.052 seconds using disk
Object Caching 383/388 objects using disk

Served from: www.sean-barton.co.uk @ 2012-02-10 11:01:20 -->
