I modified my phpstates code include to display countries and Canadian provinces as well. The country codes come from the UPS developer’s API. This is another one of those snippets that I use often, so maybe it will help you out.
Here it is → phpregions.php