I got:
foreach ($query as $sample) {
[..]
}
And I need it to be changed so if all values with
$sample['key'] == 1
Gonna be looped by the foreach and the next loop will have $sample['key'] == 0
, then it'll add for example something like:
<tr><td colspan="4">All keys with $sample['key'] == 1 are after the loop, and I'm staring to loop with $sample['key'] == 0</td></tr>
But only once.
//edited
Trying to explain more:
At first: foreach
will loop this:
foreach($query as $sample) {
*loop*
print_r($sample['key']) //1
*loop*
print_r($sample['key']) //1
...etc.
}
But if there'll be something like:
foreach($query as $sample) {
*loop*
print_r($sample['key']) //1
*loop*
*adding some content, because next print value is 0!*
print_r($sample['key']) //0!!!!!!!
}
Hope you understand it now, I've done my best to explain as best as I can. It's hard to describe, so if you have some questions, feel free to ask in the comments.