复制代码代码如下:
$this->loadexcel();//半酣phpexcel文件
$_ReadExcel = new PHPExcel_Reader_Excel2007();
if(!$_ReadExcel->canRead(' link.xls')){
$_ReadExcel = new PHPExcel_Reader_Excel5();
}
$_phpExcel = $_ReadExcel->load('link.xls');
$sheetCount = gt;getSheetCount();
$newExcel = array();
$excelData = array();
for($s = 0;$s $currentSheet = $_phpExcel->getSheet($s);
$allColumn = $currentSheet->getHighestColumn();
$allRow = $currentSheet->getHighestRow();
for($r = 1;$r<=$allRow;$r++){
for($currentColumn='A';$currentColumn<=$allColumn;$currentColumn++){
$address = $currentColumn.$r;
$newExcel[] = $currentSheet->getCell($address)->getValue();
}
}
}
後面就是对数组的操作了- -不过要先下ダウンロード好phpexcel,并包含进来
http://www.bkjia.com/PHPjc/328155.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/328155.html技術記事复制代码代码如下: $this-loadexcel();//半酣phpexcel文件 $_ReadExcel = new PHPExcel_Reader_Excel2007(); if(!$_ReadExcel-canRead('link.xls')){ $_ReadExcel = new PHPExcel_...