Example:
class MyRecursiveIteratorIterator extends RecursiveIteratorIterator{
public function current(){
echo 'START';
return parent::current();
}
}
$it = new MyRecursiveIteratorIterator(new RecursiveArrayIterator($arr));
foreach ($it as $key => $val){
// here it starts
echo $val;
// here it ends
}
So what method should I implement in my class so I can insert my stuff after each element?
If I understand the question correctly, here is code to echo the elements of a php array into a UL html list. If this is not what you’re looking for please add additional information.