PHP Get Excel table data

Source: Internet
Author: User
This article introduces the content of PHP to get Excel table data, has a certain reference value, now share to everyone, the need for friends can refer to

/* Merchant Pool import */public function Sellerpoolimport () {Import (' Component/phpexcel ', APP       _path, '. php ');        Introduce Excel processing class $PHPReader = new \phpexcel_reader_excel2007 ();  $filePath = $_files[' url ' [' Tmp_name ']; Get upload File temp directory//Judging file type if (! $PHPReader->canread ($filePath)) {$PHPReader = new \phpexcel_reader            _excel5 ();            if (! $PHPReader->canread ($filePath)) {$this->error (' Please select Excel file ', U (' Seller/sellerpoolindex '), 3);        }} $PHPExcel = $PHPReader->load ($_files[' url ' [' tmp_name ']);        /** reading the first worksheet in an Excel file *//and to the array $currentSheetArr = $PHPExcel->getsheet (0)->toarray ();        $res = D (' Seller ')->sellerpoolimport (i (' post.channeltype '), I (' Post.companycode '), $CURRENTSHEETARR);        if (!is_array ($res)) $this->error ($res, U (' Seller/sellerpoolindex '), 6); $this->success (' Import succeeded ', U (' Seller/sellerpoolindex '), 3);} 

Related recommendations:

Phpexcel Chinese Course

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.