SHARE
TWEET

Untitled

a guest Jan 20th, 2020 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. function buscaCep($cep){
  4.     $date       = file_get_contents("http://apps.widenet.com.br/busca-cep/api/cep/$cep.json");
  5.     $result     = json_decode($date, true);
  6.  
  7.     return $result;
  8. }
  9.  
  10. $cep = buscaCep('17512-560');
  11.  
  12. ?>
  13.  
  14. <p><b>Estado: </b> <?=$cep['state']?> </p>
  15. <p><b>Cidade: </b><?=$cep['city']?> </p>
  16. <p><b>Bairro: </b><?=$cep['district']?></p>
  17. <p><b>Rua: </b><?=$cep['address']?></p>
  18. <p><b>Cep: </b><?=$cep['code']?></p>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top