我的代码我尝试使用PHPexcel库导入excel。。

【问题描述】:

我正在尝试使用 PHP excel 库导入 excel。它适用于小数据。但它不适用于超过 30000 行的 excel。我尝试增加内存限制和执行时间。也需要很长时间。这是我的代码

ini_set('upload_max_filesize', '64M');
ini_set('memory_limit', '4096M');
ini_set('max_execution_time', 0);
ini_set('max_input_time', -1);
 
$fileName = $_FILES["production"]["tmp_name"];
$objPHPExcel = PHPExcel_IOFactory::load($fileName);

图片[1]-我的代码我尝试使用PHPexcel库导入excel。。-唐朝资源网

$phpspreadsheet = $objPHPExcel->getSheet(0); $total_data = $phpspreadsheet->getHighestRow(); //echo $chunkSize; // exit; $highest_column = $phpspreadsheet->getHighestColumn(); for ($row = 2 ; $row rangeToArray ('A' . $row . ':' . $highest_column . $row, NULL, TRUE, FALSE);

图片[2]-我的代码我尝试使用PHPexcel库导入excel。。-唐朝资源网

$line =htmlentities($productionDataAll[0][0]); $workedorder =htmlentities($productionDataAll[0][1]); $modelnumber =htmlentities($productionDataAll[0][2]); $revision =htmlentities($productionDataAll[0][3]); if(!empty($productionDataAll[0][4])){ $serialnumber = htmlentities($productionDataAll[0][4]); }else{ $serialnumber=''; } $lpn = htmlentities($productionDataAll[0][5]); $shift = htmlentities($productionDataAll[0][6]); $datecreated = htmlentities($productionDataAll[0][7]); $datecompleted = htmlentities($productionDataAll[0][8]); $repairflag = htmlentities($productionDataAll[0][9]); $date=date("Y-m-d", strtotime( '-1 days' ) ); $skeydate = date("Ymd", strtotime( '-1 days' ) ); $skey = $skeydate.$line;

图片[3]-我的代码我尝试使用PHPexcel库导入excel。。-唐朝资源网

$importproduction = importproduction( $mysql_connectionLinkLocal, $line, $workedorder, $modelnumber, $revision, $serialnumber, $lpn, $shift, $repairflag, $date, $skey, $datecreated, $datecompleted); }

我尝试使用块过滤器。但它不起作用。如何使用上面的代码添加块过滤器?

【讨论】:

© 版权声明
THE END
喜欢就支持一下吧
点赞213赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容