<?php
$data = array(
0 => array(
0 => 1,
),
1 => array(
0 => 2,
),
2 => array(
0 => 3,
1 => 4,
2 => 5,
),
3 => array(
0 => 6,
),
4 => array(
0 => 7,
),
);
$it = (new RecursiveArrayIterator($data));
var_dump($it);
echo PHP_EOL, implode(iterator_to_array($it)); //745 instead of 1234567
echo PHP_EOL, implode(iterator_to_array($it, true)); //745 instead of 1234567
echo PHP_EOL ;
foreach($it as $v)
{
echo $v ;
}
preferences:
29.25 ms | 406 KiB | 5 Q