1. Go to this page and download the library: Download stratadox/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/ */
stratadox / parser example snippets
use Stratadox\Parser\Helpers\Between;
use Stratadox\Parser\Parser;
use function Stratadox\Parser\any;
use function Stratadox\Parser\pattern;
function csvParser(
Parser|string $sep = ',',
Parser|string $esc = '"',
): Parser {
$newline = pattern('\r\n|\r|\n');
return Between::escaped('"', '"', $esc)
->or(any()->except($newline->or($sep)->or($esc))->repeatableString())
->mustSplit($sep)->maybe()
->split($newline)
->end();
}