On his blog today, Jason Palmer has a handy bit of code to help you validate zip codes on your website (using the Codebump.com web service).

Using the CodeBump GeoPlaces Web Service I constructed a function which takes three parameters (zip, city, state) and does a case-insensitive comparison to make sure that the given zip code matches the city and state. Upon verification the function will return true. Otherwise, it returns false.

The simple code is about 35 lines long and grabs and parses out the information with a combination of an fopen and converting the results into an XML element.