PHP code example of corviz / brasilapi-php

1. Go to this page and download the library: Download corviz/brasilapi-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

corviz / brasilapi-php example snippets


use Corviz\BrasilAPI\BankApi;

$banks = BankApi::all();

foreach ($banks as $bank) {
    echo $bank->code, ' - ', $bank->name;
}

use Corviz\BrasilAPI\CepApi;

$address = CepApi::get('13087901');

echo $address->street; //Avenida Guilherme Campos
echo $address->neighborhood; //Jardim Santa Genebra
echo $address->city; //Campinas

//and so on... 

composer