Wondering what would be a good method to get the first iteration on a foreach loop. I want to do something different on the first iteration.
Is a conditional our b
You can simply add a counter to the start, like so:
$i = 0; foreach($arr as $a){ if($i == 0) { //do ze business } //the rest $i++; }