1. Go to this page and download the library: Download jcoded/atoc-data-parser 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/ */
jcoded / atoc-data-parser example snippets
$filename = "RJFAF570.NDF";
$factory = new \JCoded\AtocDataParser\Factory();
$parser = $factory->getParser($filename);
while (($line = fgets($stream)) !== false) {
//Skip the comments
if (strpos($line, '/!!') !== false) {
continue;
}
//Get the data
try {
$data = $parser->parseLine($line);
//Do something with the data
} catch (\JCoded\AtocDataParser\IncompatibleLineException $ex) {
//Handle exception
}
}