1. Go to this page and download the library: Download kubinyete/getnet-edi 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/ */
kubinyete / getnet-edi example snippets
// Opening a new document (version 10.1)
$document = Kubinyete\Edi\Getnet\Document\Document::open('./sample/getnetextr_20240418_0000000_c101.txt');
// Sequential reading
while ($row = $document->next()) {
// Current line number that has been read
$lineNumber = $document->currentLineNumber();
// Current line contents that has been read
$lineContent = $document->currentLine();
// What type/class we got after parsing it.
$parsedType = get_class($row);
echo "Current line {$lineNumber}: '{$lineContent}'" . PHP_EOL;
echo "Parsed content ($parsedType): " . json_encode($row, JSON_PRETTY_PRINT) . PHP_EOL;
// @NOTE: This is only a sample code for visualizing each entry that has been parsed
}