我已将.xls
文件加载到Laravel Excel:
Excel::load('public/files/20160621.xls', function($reader) {
// read a cell value
});
如何读取加载的excel文件的单元格值?文档似乎不清楚。
答案 0 :(得分:8)
public function get()
{
$excelFile ...
return Excel::load($excelFile, function($doc) {
$sheet = $doc->getSheetByName('data'); // sheet with name data, but you can also use sheet indexes.
$sheet->getCell('A1');
$sheet->getCellByColumnAndRow(0,0);
});
}
你是对的,阅读一些细胞的文档还不清楚。 希望这会对你有所帮助。
答案 1 :(得分:0)
供阅读使用
public function reader($file)
{
$excel=Excel::load($file, function($reader) {
$reader->...//Document propities
$sheet = $doc->getSheet(0); // sheet with index
$cell=$sheet->getCell('A1')->getValue();
})->toArray()//get();
...
$cell=$excel->index//[row][col] Get formatted type(date,currency,calculated) cells
...
}
答案 2 :(得分:-1)