In the current version of my project, I can only get a cell value using getCell("A4")->getValue()
, but there's a problem, sometime I want to delete or add a column, it will disrupt other values, so I have to sort my data again. I want to know if there is a function, that can give me cell using using a number as a column insted of a letter, exemple: "A4" from $title['first'][4], and "B5" from $title['second'][5] image of exemple
Maybe my expression is not clear enough,I hope you can get my point/question, thanks!
$colunmn=1; //The colunmn you want to start the cicle
$columnMax=5; //The colunmn you want to end the cicle
while($coluna < $columnMax){
$colunmString = PHPExcel_Cell::stringFromColumnIndex($colunmn); //Convert the nº index into a collunm string ex: 1->'A', 2->'B', 27->'AA', 28->'AB'
getCell($colunmString. "2")->getValue(); //I used "2" as a line exemple you can change it
$colunmString++;
}
You can adapt that code to your needs. Just use the function PHPExcel_Cell::stringFromColumnIndex( int )
to get the column string with an int index.