Creating a SELECT list of states with php

I’m posting this short chunk of php code that might save you a few minutes. It creates a list of US states in an HTML or XHTML SELECT list. Download the zip file here.

This is nothing big, but it might save someone 20 minutes worth of work. Basically, if you want to create a drop down list of US states using php you can include this code. Download the source here: states.zip (1.2K)

Here are a couple of examples of what this code does:


That’s all it does.