PHP code example of alexandreo / correios

1. Go to this page and download the library: Download alexandreo/correios 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/ */

    

alexandreo / correios example snippets



use Alexandreo\Correios\CorreioAtendeCliente;

$correioAtendeCliente = new CorreioAtendeCliente();

try {
    $data = $correioAtendeCliente->consultaCep('02038010');
    var_dump($data);
} catch (\Alexandreo\Correios\CorreioException $e) {//get error
    echo $e->getMessage();
}