Created
November 22, 2023 19:23
-
-
Save madeinnordeste/26ecae7ec7a78bcdbd94eb9024bc3d78 to your computer and use it in GitHub Desktop.
via cep api
This file contains hidden or 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
public function consultZip($zip) | |
{ | |
$client = new Client(["http://viacep.com.br/ws/" . $zip . "/json/"]); | |
$result = $client->request('get', "http://viacep.com.br/ws/" . $zip . "/json/", ['Accept' => 'application/json']); | |
$output = $result->getBody()->getContents(); | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment