如何从 Laravel Excel 大小的网站中获取 A3 的值
How to get value from A3 in Laravel Excel maatwebsite
我用Laravel Excel and I have data at ''A3'' cell. How to get it? I take this code is not working. It's show all data in that sheet.
$sheet = $doc->getSheetByName('data');
$sheet->getCell('A3');
我正在使用too.You可以通过dd检查数组,得到需要的cell。
public function loadExcel(Request $request)
{
$path = $request->file('file')->getRealPath();
$records = \Excel::load($path, function ($reader) {
$reader->noHeading();
})->get()[0]->toArray();
dd($records);
//When you find the index of needed cell just $needed_cell = $records['index'];
}
我用Laravel Excel and I have data at ''A3'' cell. How to get it? I take this code is not working. It's show all data in that sheet.
$sheet = $doc->getSheetByName('data');
$sheet->getCell('A3');
我正在使用too.You可以通过dd检查数组,得到需要的cell。
public function loadExcel(Request $request)
{
$path = $request->file('file')->getRealPath();
$records = \Excel::load($path, function ($reader) {
$reader->noHeading();
})->get()[0]->toArray();
dd($records);
//When you find the index of needed cell just $needed_cell = $records['index'];
}