PHP code example of silarhi / caf-parser

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

    

silarhi / caf-parser example snippets


use Silarhi\Caf\Parser\PaymentSlipParser;

$paymentSlip = (new PaymentSlipParser())->parse(file_get_contents('/path/to/LA44ZZ.txt'));

$paymentSlip->getPaymentDate(); // DateTimeInterface
$paymentSlip->getTotalAmount(); // e.g. 600.0

foreach ($paymentSlip->getLines() as $line) {
    $line->getBeneficiaryName(); // e.g. "MME EXEMPLE ALICE"
    $line->getNetAmount();       // e.g. 312.0
}