Copy CodeThe code is as follows:
$this->loadexcel ();//involves Phpexcel file
$_readexcel = new phpexcel_reader_excel2007 ();
if (!$_readexcel->canread (' Link.xls ')) {
$_readexcel = new Phpexcel_reader_excel5 ();
}
$_phpexcel = $_readexcel->load (' Link.xls ');
$sheetCount = $_phpexcel->getsheetcount ();
$newExcel = Array ();
$excelData = Array ();
for ($s = 0; $s < $sheetCount; $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 ();
}
}
}
The following is the operation of the array-but first download the Phpexcel and include
http://www.bkjia.com/PHPjc/328155.html www.bkjia.com true http://www.bkjia.com/PHPjc/328155.html techarticle Copy the code as follows: $this-loadexcel ();//involves phpexcel file $_readexcel = new phpexcel_reader_excel2007 (); if (!$_ Readexcel-canread (' Link.xls ')) {$_readexcel = new phpexcel_ ...