PHP code example of einfacharchiv / extractor

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

    

einfacharchiv / extractor example snippets


$text = <<<EOT
Rechnungsnummer: 4711
Rechnungsdatum: 20.11.2077
Rechnungsbetrag: 119,00 €
...
EOT;

// Pass the text and the locales (the methods return the values in the same order)
$extractor = new \einfachArchiv\Extractor\Extractor($text, ['de', 'en']);

// Available methods
$extractor->findAmounts();
$extractor->findBics();
$extractor->findCompanyNames();
$extractor->findCompanyRegisterIds();
$extractor->findCustomerIds();
$extractor->findDates();
$extractor->findEmails();
$extractor->findIbans();
$extractor->findInvoiceIds();
$extractor->findPaymentReferences();
$extractor->findTaxNumbers();
$extractor->findTypes();
$extractor->findVatNumbers();
$extractor->findWebsites();

[
    [
        'amount' => 119,
        'currency' => 'EUR',
    ],
    ...
];

[
    [
        'area' => 'HRB',
        'number' => '123456',
        'office' => 'Stuttgart',
    ],
    ...
];

$dates = $extractor->findDates();

\Carbon\Carbon::parse($dates[0])->toDateString();

[
    [
        'number' => '12345/67890',
        'state' => 'BW',
    ],
    ...
];

[
    'invoice',
    'credit-note',
    'reminder',
    'salary-statement',
    'bank-statement',
    'contract',
    'balance-sheet',
    'tax-assessment-note',
];