2016-04-13 164 views
0

我使用simplexlsx閱讀XLSX表中的所有電子表格,XLSX文件,閱讀在PHP

我在XLSX文件中的多個標籤,當我試圖讀取數據,其顯示僅第一個標籤數據,

爲了更好地理解我已附加打印屏幕。

enter image description here

+0

結帳PHP Excel https://github.com/PHPOffice/PHPExcel http://stackoverflow.com/questions/11617077/looping-through-worksheets-with-phpexcel,http://stackoverflow.com/questions/23081669/read-only-specific-sheets –

回答

1

試試這個,

$這個 - >負載>庫( 'simplexlsx');

$ xlsx = new SimpleXLSX($ file_path);

$ data ['csv_data'] = $ xlsx-> rows();

1

這是因爲當你選擇一個Excel文件的東西它執行與活動工作表是在默認情況下是第一個採取行動。

您需要更改到所需表單 使用下面的代碼做

$objPHPExcel->setActiveSheetIndex($count); // Use no of the sheet you want to select -1 as count 
+0

謝謝Satyapal Sharma。 –