1. Go to this page and download the library: Download rakdar/reactphp-csv 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/ */
rakdar / reactphp-csv example snippets
$loop = React\EventLoop\Factory::create();
$inputFd = fopen('country-codes.csv', 'r');
$input = new Rakdar\React\Csv\Reader(
new React\Stream\ReadableResourceStream($inputFd, $loop)
);
$input->on('data', function ($field) {
echo $field[10] . PHP_EOL;
});
$loop->run();