PHP code example of rhberro / correio-services

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

    

rhberro / correio-services example snippets


$response = Rhberro\Correios\Request::deadlinePrice('13450044', '13466070', '1.2', '16', '21.8', '15.0', '15.0', '40010');

$response = Rhberro\Correios\Request::price('13450044', '13466070', '1.2', '16', '21.8', '15.0', '15.0', '40010');

$response = Rhberro\Correios\Request::deadline('13450044', '13466070', '40010');

$response = Rhberro\Correios\Request::deadline('13450044', '13466070', '40010');

foreach ($response->getServices() as $service) {
    $code = $service->Codigo;
    $deadline = $service->Valor;
}