Border-States-API is a project mainly written in PHP, it's free.
Returns a list of bordering U.S. states for an inputed state
Allows you to specify a U.S. state and returns all of the bordering states in a JSON request.
You can use this API freely at
http://teladesign.net/API/borders.php?state=[yourstatehere]
When you specify the variable state in the URL parameter it returns a JSON formatted page with a comma separated list of bordering states.
{ -result: { border_states: "WV,MD,DC,NC,KY,TN" } }