Hello! There is an excel file, in this file you need to change one column. With PHPExcel I get data from this column, change this data and now I need to put this new data back into this column and save the file. How can you do this, or how can you get an excel cell number using php.
1 answer
The procedure is approximately as follows:
- You open the file for reading, get the necessary data, carry out the necessary calculations, getting new values.
- Add new values to the file. To access a single cell, you can use the
setCellValuemethod.
$xls->setActiveSheetIndex(0)->setCellValue('A1', 'Hello world!')
- Open a stream for writing, upload a modified file into it, save the file with the same name as the original one, overwriting the old version of the file.
|