How can I accomplish this in php? there are cases where I need to push more elements to the array that i'm looping through so they also get looped through:
$j = array(1,2,3);
foreach ($j as $i)
{
echo $i . "\n";
if ($i <= 3)
array_push($j, 5);
}
should print 123555 but it stops at 123.
is there a way around this in php?