thinkphp+PHPExcel import

WBOY
Release: 2016-08-08 09:30:44
Original
1129 people have browsed it

Download PHPExcel and unzip it into the ThinkPHPExtendVendor framework

Step 2:

                Vendor('Classes.PHPExcel');
                $objPHPExcel = PHPExcel_IOFactory::load($path);
                $excelarray= $objPHPExcel->getSheet(0)->toArray();
                array_shift($excelarray);//删除数组第一行数据
                foreach ($excelarray as $k => $v) {
                  $data[$k]['字段1'] = $v[0];
                  ....
                 }
Copy after login
completed

The above introduces thinkphp+PHPExcel import, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template