If you have a script that does abbreviation to name, it should be very simple to convert it to the reverse, as I would assume it already has the array populated for you. If it is structured as array('NJ' => 'New Jersey'), then just do $abbrev = array_search('New Jersey', $stateArray).