$this->loadexcel();//半酣phpexcel文件<BR> $_ReadExcel = new PHPExcel_Reader_Excel2007();<BR> if(!$_ReadExcel->canRead('link.xls')){<BR> $_ReadExcel = new PHPExcel_Reader_Excel5();<BR> }<BR> $_phpExcel = $_ReadExcel->load('link.xls');<BR> $sheetCount = $_phpExcel->getSheetCount();<BR> $newExcel = array();<BR> $excelData = array();</P><P> for($s = 0;$s<$sheetCount;$s++) {<BR> $currentSheet = $_phpExcel->getSheet($s);<BR> $allColumn = $currentSheet->getHighestColumn();<BR> $allRow = $currentSheet->getHighestRow();<BR> for($r = 1;$r<=$allRow;$r++){<br><br> for($currentColumn='A';$currentColumn<=$allColumn;$currentColumn++){<BR> <b>%本文@来源gao@!dai!ma.com搞$$代^@码!网</b><strong>搞代gaodaima码</strong> $address = $currentColumn.$r;<BR> $newExcel[] = $currentSheet->getCell($address)->getValue();<BR> }<BR> }<BR> }<BR>
后面就是对数组的操作了–不过要先下载好phpexcel,并包含进来