Step 2:
Vendor('Classes.PHPExcel'); $objPHPExcel = PHPExcel_IOFactory::load($path); $excelarray= $objPHPExcel->getSheet(0)->toArray(); array_shift($excelarray);//删除数组第一行数据 foreach ($excelarray as $k => $v) { $data[$k]['字段1'] = $v[0]; .... }
The above introduces thinkphp+PHPExcel import, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.