I have the following loop:
for($column = 'A'; $column != $lastColumn; $column++) {
for ($row = 2; $row <= 6; $row++) {
$cell[] = $objWorksheet->getCell($column.$row)->getFormattedValue();
if($column == 'A') {
$arrayTeste = array('A' => $cell);
} else {
$arrayTeste = array('B' => $cell);
}
}
}
What I want is: I want to make a new array with key 'A' using the values in 'cell' array. Because in another part of my code I need to echo just the values inside 'A' key. Like when you echo from a DB index. Example: echo $array['A']. Also in this second part, I'll need a foreach to print all the array, right?
arrayTesteon every loop iteration, and will end up with only the LAST value when both loops exit.rangeToArray()method that's already buit into PHPExcel?