PHP code example of mimographix / qif-library
1. Go to this page and download the library: Download mimographix/qif-library 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/ */
mimographix / qif-library example snippets
// Instatiate the QIF Parser
$qifParser = new MimoGraphix\QIF\Parser( $filePath );
$qifParser->parse();
foreach( $qifParser->getTransactions() as $transaction )
{
// your code
}
// Instatiate the QIF Writer
$qif = new MimoGraphix\QIF\Writer();
// Create a new transaction
$transaction = new Transaction( Enums\Types::CASH );
$transaction->setDate( new Carbon( '2019-12-31' ) )
->setDescription( 'INV666: ' )
->setAmount( 18.99 )
->setCategory( 'Sales' )
->addSplit( 'Sales', 18 )
->addSplit( 'Tax', 0.99 )
->markAsReconciled();
// Add it to the QIF
$qif->addTransaction( $transaction );
echo $qif;