Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function buscaCep($cep){
- $date = file_get_contents("http://apps.widenet.com.br/busca-cep/api/cep/$cep.json");
- $result = json_decode($date, true);
- return $result;
- }
- $cep = buscaCep('17512-560');
- ?>
- <p><b>Estado: </b> <?=$cep['state']?> </p>
- <p><b>Cidade: </b><?=$cep['city']?> </p>
- <p><b>Bairro: </b><?=$cep['district']?></p>
- <p><b>Rua: </b><?=$cep['address']?></p>
- <p><b>Cep: </b><?=$cep['code']?></p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement