i read a csv file from a server and i loop through it using foreach:
if (file_exists($fi)){
$lines = file($fi);
foreach ($lines as $line_num => $line) {
// do something ....
if ($addline){
$newline = "123;Las Vegas;982";
array_push($lines, $newline);
}
}
}
While looping through the array i decide to add a new element to the end of the array and i like to process this element in the same foreach-loop.
In the other post you only have mulitple pointer to the same array. I dont want to run the array twice.