我想在PHP中将此xls文件检索为数组:
我试过这段代码:
App::import('Vendor', 'PHPExcel', array('file' => 'PHPExcel.php'));
$excelFile = DAY_DIR."/data.xlsx";
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load($excelFile);
//Itrating through all the sheets in the excel workbook and storing the array data
foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
$arrayData[$worksheet->getTitle()] = $worksheet->toArray();
}
pr($arrayData);
请建议我如何实现它。