使用php語言,能否把excel當(dāng)成是table表那樣進(jìn)行查詢,獲取數(shù)據(jù)?
歡迎選擇我的課程,讓我們一起見證您的進(jìn)步~~
https://github.com/ouardisoft/OSExcelBundle
用法:
讀取excel service
$excel = $this->get('os.excel');
打開excel
$excel->loadFile([FILE_PATHNAME]);
選擇sheet
$excel->setActiveSheet([INDEX_OF_SHEET]);
sheet數(shù)
$excel->getSheetCount();
sheet名
$excel->getSheetNames();
讀取行數(shù)
$excel->getRowCount();
讀取字段數(shù)
$excel->getColumnCount();
最后一個字段的索引
$excel->getHighestColumn();
行數(shù)據(jù)
$excel->getRowData([INDEX_OF_ROW]);
單元格數(shù)據(jù)
$excel->getCellData([INDEX_OF_ROW], [INDEX_OF_COLUMN]);
把excel數(shù)據(jù)讀取為PHP數(shù)組
$excel->getSheetData();