Hi
I have a two dimensional array and would like to output the results in groups depending upon one of the fields in the array. While i have managed this and have figured out how to create a header for each group, i would now like to create a footer (end of group) line where i could create a subtotal or similar.
my working code with the header is below but how do i add the footer?
$group = null;
for($i=0;$i<count($rowKitCharges);$i++){
if($rowKitCharges[$i]['SubCategory'] != $group)
{
//echo the group header
echo "<br><b>" . $rowKitCharges[$i]['SubCategory'] . "</b><br>";
$group = $rowKitCharges[$i]['SubCategory'];
}
echo $rowKitCharges[$i]['HireID'] . " " . $rowKitCharges[$i]['SubCategory'];
echo "<br>";
}
Thanks
Jon