Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Iterates through the text line by line
PHP Shell
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
tests
.gitignore
.travis.yml
README.md
composer.json

README.md

h4kuna\iterators

Build Status

Best way to install h4kuna\iterators is using composer.

$ composer require h4kuna/iterators

TextIterator

Read the text line by line.

$incomingString = "  foo

bar
joe";

$textIterator = new TextIterator($incomingString);
$textIterator->setFlags($textIterator::SKIP_EMPTY_LINE | $textIterator::TRIM_LINE);
foreach($textIterator as $line) {
    echo $line;
}
/*
 * output will be trimed
foo
bar
joe
*/

Base64Array

Create hash based on the base_64 from array and back.

$array = new Base64Array(array('milan', 'matejcek'));
echo $array; // YToyOntpOjA7czo1OiJtaWxhbiI7aToxO3M6ODoibWF0ZWpjZWsiO30=

$array = new Base64Array('YToyOntpOjA7czo1OiJtaWxhbiI7aToxO3M6ODoibWF0ZWpjZWsiO30=');
var_dump((array) $array); // array('milan', 'matejcek')

ArrayRound

Non-ended array.

$array = new ArrayRound(array('foo', 'bar', 'joe'));
$array->item(); // foo
$array->item(); // bar
$array->item(); // joe
$array->item(); // foo
// and go next
Something went wrong with that request. Please try again.