PHP code example of tsufeki / react-line-stream
1. Go to this page and download the library: Download tsufeki/react-line-stream 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/ */
tsufeki / react-line-stream example snippets
$loop = React\EventLoop\Factory::create();
$file = new React\Stream\Stream(fopen('foo.txt', 'r'), $loop);
$lineStream = new ReactLineStream\LineStream($file);
$lineStream->on('line', function ($line) {
echo 'line: ' . $line;
});
$loop->run();