1.將PHPExcel文件放入Thinkphp/library/Org/util 目錄下
2.在項目中引入PHPExcel。import("Org.Util.PHPExcel");
</pre><pre name="code" class="php">$PHPExcel=new \PHPExcel();
$savePath = './Uploads/'.$info['savepath'].$info['savename'];
$PHPExcel=$PHPReader->load($savePath);
$currentSheet=$PHPExcel->getSheet(0);//讀第一個表,如果有多個,修改傳遞參數
$allColumn=$currentSheet->getHighestColumn();//獲取列數
$allRow=$currentSheet->getHighestRow();//獲取行數
for($currentRow=2;$currentRow<=$allRow;$currentRow++){
//取數據
$firstName = $currentSheet->getCell("A".$currentRow)->getValue();
}