PHP code example of kingsquare / php-mt940

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

    

kingsquare / php-mt940 example snippets



// ... load everything ... //

// instantiate the actual parser
// and parse them from a given file, this could be any file or a posted string
$parser = new \Kingsquare\Parser\Banking\Mt940();
$tmpFile = __DIR__.'/test.mta';
$parsedStatements = $parser->parse(file_get_contents($tmpFile));


// ... load everything ... //

class MyCustomMt940Engine extends \Kingsquare\Parser\Banking\Mt940\Engine {
    // add your overrides / overloads and custom logic here
}

// instantiate the actual parser
// and parse them from a given file, this could be any file or a posted string
$parser = new \Kingsquare\Parser\Banking\Mt940();
$engine = new MyCustomMt940Engine();
$tmpFile = __DIR__.'/test.mta';
$parsedStatements = $parser->parse(file_get_contents($tmpFile), $engine);
 composer