PHP读取excel文件的一个简单示例

复制代码代码如下所示:
(美元-> loadexcel); / /包含任何PHPExcel文件
_readexcel美元=新phpexcel_reader_excel2007();
如果(!_readexcel美元->阅读('link .xls)){
_readexcel美元=新phpexcel_reader_excel5();
}
_phpexcel美元=美元_readexcel ->负荷('link .xls);
sheetcount美元=美元_phpexcel -> getsheetcount();
newexcel美元=阵();
exceldata美元=阵();

为($ S = 0;美元美元美元的<< sheetcount;+ +){
美元_phpexcel -> getsheet电流片= $(美元的);
allcolumn美元=美元-> gethighestcolumn电流片();
allrow美元=美元-> gethighestrow电流片();
为($ R = 1;r < = $ allrow;r + +){

为($ currentcolumn = a;< = currentcolumn美元美元美元allcolumn;currentcolumn ++){
美元美元美元currentcolumn地址= R;
newexcel美元{ } = $电流片-> getcell($地址)-> getValue();
}
}
}

背面是对数组的操作,但下载PHPExcel第一和包括它。