Skip to content

mwbgrob/stringstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Php StringStream

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Php Stringstream data structure.

Installation

composer require golding/stringstream

Usage

<?php
    use Golding\stringstream\StringStream;
    
    require(__DIR__ . '/vendor/autoload.php');
    
    $stream = new StringStream("Hello, World!");
    
    do {
        if($stream->currentAscii()->isWhiteSpace()) {
            $stream->ignoreWhitespace();
        } else {
            echo $stream->current().PHP_EOL;
            $stream->next();
        }
    
    } while (! $stream->isEnd());

License

released under the MIT License. See the bundled LICENSE file for details.