代码如下:
$this->loadexcel();//半酣@R_301_461@excel文件
$_ReadExcel = new @R_301_461@Excel_Reader_Excel2007();
if(!$_ReadExcel->canRead('link.xls')){
$_ReadExcel = new @R_301_461@Excel_Reader_Excel5();
}
$_@R_301_461@Excel = $_ReadExcel->load('link.xls');
$sheetCount = $_@R_301_461@Excel->getSheetCount();
$newExcel = array();
$excelData = array();
$_ReadExcel = new @R_301_461@Excel_Reader_Excel2007();
if(!$_ReadExcel->canRead('link.xls')){
$_ReadExcel = new @R_301_461@Excel_Reader_Excel5();
}
$_@R_301_461@Excel = $_ReadExcel->load('link.xls');
$sheetCount = $_@R_301_461@Excel->getSheetCount();
$newExcel = array();
$excelData = array();
for($s = 0;$s<$sheetCount;$s++) {
$currentSheet = $_@R_301_461@Excel->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();
}
}
}
后面就是对数组的操作了--不过要先下载好@R_301_461@excel,并包含进来