Last active
March 18, 2018 14:08
-
-
Save adinan-cenci/6cedc0449b36d42a1c99386cff1a81d0 to your computer and use it in GitHub Desktop.
Dois serviços para a busca de endereço via CEP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function republicaVirtualGetAddressByCep($cep, $format = 'json') | |
{ | |
$ch = curl_init("http://cep.republicavirtual.com.br/web_cep.php?cep=$cep&formato=$format"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$data = curl_exec($ch); | |
curl_close ($ch); | |
return $data; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function widenetGetAddressByCep($cep, $format = 'json') | |
{ | |
$ch = curl_init("http://apps.widenet.com.br/busca-cep/api/cep.$format?code=$cep"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$data = curl_exec($ch); | |
curl_close ($ch); | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment