Know region of the city from the zip code
I would like to know if someone has already solved a similar problem: in my system has a form and a zip code field, when the user enters the zip code wanted to know the region of it if it is north, west, east and etc.... I saw that in the post office does not report anything related to the region, can someone give me a light?
Example: the user will enter the zip code: 01505-010 and the system will tell which region of the city this zip code is from
1 answers
Create a table with the information:
Rondônia RO NORTE Acre AC NORTE Amazonas AM NORTE Roraima RR NORTE Pará PA NORTE Amapá AP NORTE Tocantins TO NORTE Maranhão MA NORDESTE Piauí PI NORDESTE Ceará CE NORDESTE Rio Grande do Norte RN NORDESTE Paraíba PB NORDESTE Pernambuco PE NORDESTE Alagoas AL NORDESTE Sergipe SE NORDESTE Bahia BA NORDESTE Minas Gerais MG SUDESTE Espírito Santo ES SUDESTE Rio de Janeiro RJ SUDESTE São Paulo SP SUDESTE Paraná PR SUL Santa Catarina SC SUL Rio Grande do Sul RS SUL Mato Grosso do Sul MS CENTRO OESTE Mato Grosso MT CENTRO OESTE Goiás GO CENTRO OESTE Distrito Federal DF CENTRO OESTE
When you know the state searches this table for the region. This can be within a json and javascript searches the region by state, or within the database.
Below the Post Office ZIP code database structure. These would be the possible data to be extracted through the ZIP code.