thinkphp中PHPExcel用法

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();
}



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章