PHP Class: Geographic Codes & Names

This is a handy little class I wrote because I didn’t want to keep re-creating lists of U.S. states on contact forms. It’s pretty simple, containing arrays of state and country names, with the standard two-letter abbreviations used for the keys, and just a few methods for looking up a state or country, and for building the HTML <option> lists for use in a <select> construct.

You can view the direct source of the class here, or download it in one of the following formats: