Knowing the city from the zip code

0

I would like to know if someone has solved a similar problem: in my system has a form and a zip field, when the user type the zip he wanted to know the region of his if it is north, west, east and etc .... vi that in the post office does not inform 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 you which zip code the zip code is in.

    
asked by anonymous 04.06.2017 / 00:04

1 answer

0

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

Then when you know the search state in this table the region. This can be within a json and javascript performs the region search by state, or within the database.

Below the postal code database structure. These would be the possible data to extract through the CEP.

    
04.06.2017 / 00:12