I am using lucidFrame consoletable to create an output using json. my code below is
$table = new ConsoleTable();
$table
->setHeaders($strData->header)
->hideBorder();
foreach ($strData->body as $ins) {
$items = [];
foreach ($ins as $key=>$value) {
array_push($items,$value);
}
$table->addRow($items);
// $i++;
}
$table->addBorderLine();
fwrite($fp, str_replace('</pre>','', str_replace('<pre >','',''. $finalHead . $table->getTable().$finalFooter )));
fclose($fp);
and my result is
** COMP ** STATEMENT as on 12/08/2021
colhead1 colhead2
----------------------------------
CC Limit 1,000
Availed Limit 10,621
PM Stock Value 75,095
RM Stock Value 67,895
Product Stock Value 46,456
Total Stock Value 1,446
75% of stock value 1,835
Investment 0
----------------------------------
*Report taken by NATH on 20/08/2021 at 12:08:22 in PLACE*
I want to repeat headers after each two rows. How can I do this ? Please help My desired output will be like this
** COMP ** STATEMENT as on 12/08/2021
colhead1 colhead2
----------------------------------
CC Limit 1,000
Availed Limit 10,621
** COMP ** STATEMENT as on 12/08/2021
colhead1 colhead2
----------------------------------
PM Stock Value 75,095
RM Stock Value 67,895
** COMP ** STATEMENT as on 12/08/2021
colhead1 colhead2
----------------------------------
Product Stock Value 46,456
Total Stock Value 1,446
** COMP ** STATEMENT as on 12/08/2021
colhead1 colhead2
----------------------------------
75% of stock value 1,835
Investment 0
----------------------------------
*Report taken by NATH on 20/08/2021 at 12:08:22 in PLACE*
thanks in advance