1. Go to this page and download the library: Download jstewmc/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/ */
jstewmc / stream example snippets
use Jstewmc\Stream\Text;
$characters = new Text('foo');
while (false !== $characters->current()) {
echo "{$characters->current()}\n";
$characters->next();
}
use Jstewmc\Stream\{File, Text};
$textCharacters = new Text('foo');
$fileCharacters = new File('/path/to/file.txt');
use Jstewmc\{Chunker, Stream};
$textChunks = new Chunker\Text('foo', 'UTF-8', 16384 /* characters */);
$textCharacters = new Stream\Text($textChunks);
$fileChunks = new Chunker\File('/path/to/file.txt', 'UTF-8', 65536 /* bytes */);
$fileCharacters = new Stream\File($fileChunks);
use Jstewmc\Stream\Text;
$characters = new Text('bar');
while (false !== $characters->current()) {
echo "{$characters->current()}\n";
$characters->next();
}