色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php讀取excel文件的簡(jiǎn)單實(shí)例

復(fù)制代碼 代碼如下:
     $this->loadexcel();//半酣phpexcel文件
            $_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();
                    }
                }
            }

后面就是對(duì)數(shù)組的操作了--不過要先下載好phpexcel,并包含進(jìn)來

php技術(shù)php讀取excel文件的簡(jiǎn)單實(shí)例,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 通州区| 横山县| 乌恰县| 三江| 万宁市| 中西区| 龙游县| 遂溪县| 沂水县| 莒南县| 彩票| 安徽省| 江华| 株洲县| 邯郸县| 华安县| 万宁市| 沙田区| 衡水市| 将乐县| 天峨县| 铜梁县| 延津县| 白玉县| 开平市| 彝良县| 大余县| 兴国县| 东丽区| 清水县| 台东县| 内乡县| 西贡区| 洮南市| 巴中市| 天气| 舟山市| 镇赉县| 莱阳市| 慈溪市| 潜江市|