Cannot import large amounts of data with Phpexcelreader
I found an example on the Internet, you can import the Excel file into the database through Phpexcel, but once the data is more than 122, such as 123 data in an Excel file cannot be imported. I'm talking about code stickers, everybody look at:
Require_once '. /phpexcelreader/excel/reader.php ';
$data = new Spreadsheet_excel_reader ();
$data->setoutputencoding (' GB2312 ');
$data->read ('.. /lfx.xls ');
}
for ($i = 1; $i <= $data->sheets[0][' numrows '); $i + +)
{
for ($j = 1; $j <= $data->sheets[0][' numcols '); $j + +)
{
echo $data->sheets[0][' cells ' [$i] [$j];
}
}
The above code in the Excel file is less than 123 can print out all the records on the Web page, but greater than or equal to 123 is blank, and I need to import more than 5,000 data, distress.
Attach Phpexcelreader as well as my Excel
Thank you all!
------to solve the idea----------------------
/*
* phpexcel.v1.7.6 Version [read Example]
*/
Include ' phpexcel/iofactory.php ';
$filename = "D:/test.xls";
$readType = Phpexcel_iofactory::identify ($filename); Get without knowing the document type
$excelReader = Phpexcel_iofactory::createreader ($readType);
$PHPEXCELOBJ = $excelReader->load ($filename);
$currentSheet = $PHPEXCELOBJ->getsheet (0); Select the form with the first form (SHEET1) as the current action
$excelRows = $currentSheet->gethighestrow (); Get Maximum row
$excelColumn = $currentSheet->gethighestcolumn (); Get maximum column
foreach (Range (1, $excelRows) as $row) {
$line = '';
foreach (Range (' A ', $excelColumn) as $column) {
$line. = $currentSheet->getcell ($column. $row)->getvalue (). ",";
}
$line. = '
';
Echo $line;
}
------to solve the idea----------------------
References:
I found an example on the Internet, you can import the Excel file into the database through Phpexcel, but once the data is more than 122, such as 123 data in an Excel file cannot be imported. I'm talking about code stickers, everybody look at:
Require_once '. /phpexcelreader/excel/reader.php ';
$data = new Spreadsheet_excel_reader ();
$data->setoutput
...
Use this bar: http://www.phpclasses.org/package/6235-PHP-Parse-and-access-binary-Excel-files-in-pure-PHP.html
It feels good after use, supports Chinese, and supports xlsx format, which iterates through all the tables, columns, rows, and cells. Before also used Phpexcelreader, found more problems, so found this.