$values = array(...);
foreach($values as $value) {
// do something
}
How to run each $value
after finishing the previous?
Thanks.
$values = array(...);
foreach($values as $value) {
// do something
}
How to run each $value
after finishing the previous?
Thanks.
As far as I can tell, this loop does exactly what you want it to. The iterations don't all start at the same time; they are run in the order of the elements of the $values
array.
How exactly do you mean? foreach ist working one value after the other. You can easily proof that with something like that:
$values = array(1, 2, 3, 4, 5);
foreach($values as $value){
echo 'Working on value '.$value.'<br />\n';
echo 'Finished working on value '.$value.'<br />\n';
}
Or did I miss something there?