PHP code example of beccha / ofxparser

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

    

beccha / ofxparser example snippets


$ofxParser = new \Beccha\OfxParser\Parser();
$ofx = $ofxParser->loadFromFile('/path/to/your/bankstatement.ofx');

$bankAccounts = $ofx->getBankAccounts();
$firstBankAccount = $bankAccounts[0];

// Get the statement start and end dates
$startDate = $firstBankAccount->getStatement()->getStartDate();
$endDate = $firstBankAccount->getStatement()->getEndDate();

// Get the statement transactions for the account
$transactions = $firstBankAccount->getStatement()->getTransactions();