- array_chunk: documentation ( source)
- print_r: documentation ( source)
- array_fill: documentation ( source)
- range: documentation ( source)
<?php
echo "<pre>";
$array = array_fill(0, 10, range("A", "Z"));
function getTests($array) {
$it = new ArrayIterator($array);
$tests = array();
foreach ( $it as $range ) {
foreach ( array_chunk($range, 2) as $chunk ) {
yield $chunk;
}
}
}
foreach(getTests($array) as $value)
{
print_r($value);
}
?>