php change excel data array loop type -
i reading big files data .xlsx format via php library "spout" working fine how print data not matching application.
this how print table now
<?php foreach ($reader->getsheetiterator() $sheet) { foreach ($sheet->getrowiterator() $rows) { ?> <tr class="datalistarray"> <?php foreach ($rows $index => $row) { ?> <td <?php if ($index == 0) { echo 'class="paricipant '.trim($rows[1]).'"'; ?> id="<?php echo trim($rows[1]).''.trim($rows[0]); ?>" <?php } else if ($index == 2) { echo 'class="'.trim($rows[1]).'-cxtrem"'; } else if ($index == 1) { echo 'id="room"'; } ?>> <?php if ($row instanceof datetime) { //print_r($row); echo $row->format("d-m-y"); } else { echo $row; } ?></td> <?php } ?> </tr> <?php } } ?>
but want print way have more control on html make customize
<?php $count = 1; foreach($sheetdata $rec) { $meeting = trim($rec['b']); $participant = cleanstring($rec['a']); $rpg = trim($rec['c']); $date = trim($rec['d']); ?> <tr class="datalistarray"> <th class="paricipant <?php echo $meeting; ?>" id="<?php echo $meeting.''.$participant; ?>"><?php echo $rec['a'];?></th> <th id="room"><?php echo $meeting; ?></th> <th class="<?php echo $meeting; ?>-cxtrem"><?php echo $rec['c'];?></th> <th><?php echo $rec['d'];?></th> <th><?php echo $rec['e'];?></th> <th><?php echo $rec['f'];?></th> <th><?php echo $rec['g'];?></th> <th><?php echo $rec['h'];?></th> <th><?php echo $rec['i'];?></th> <th><?php echo $rec['j'];?></th> <th><?php echo $rec['k'];?></th> <th><?php echo $rec['l'];?></th> <th><?php echo $rec['m'];?></th> <th><?php echo $rec['n'];?></th> <th><?php echo $rec['o'];?></th> <th><?php echo $rec['p'];?></th> <th><?php echo $rec['q'];?></th> <th><?php echo $rec['r'];?></th> <th><?php echo $rec['s'];?></th> <th><?php echo $rec['t'];?></th> </tr> <?php } ?>
Comments
Post a Comment