I have this code
foreach ($objWorksheet->getRowIterator() as $row) {
$output[] = array();
//adding a blank array to the end doesn't seem to
//advance the array pointer so do it manually.
$test = end($output);
$cellIterator = $row->getCellIterator();
foreach ($cellIterator as $cell) {
//specifically this bit
$output[key($output)][] = $cell->getValue();
}
}
But I don’t like how I’ve found the current key using
$output[key($output)][] = $cell->getValue();
Is there a better approach?
Why don’t you use another variable?