簡體   English   中英

使用 PHP 讀取 Excel 文件

[英]Read Excel file using PHP

我需要讀取一個 XLS 文件的內容,該文件有 10 列,其中一列包含浮點值,如 (10.5, 78.88)。

但是,當我嘗試讀取值時,我得到了類似 (105, 7888) 的值,請在這方面幫助我提供任何示例代碼或任何有效的解決方案。

您可以嘗試按照教程@ http://www.ibm.com/developerworks/opensource/library/os-phpexcel/index.html來查看您為使當前代碼正常工作所做的不同工作。

希望有幫助。

您可以使用 PHPExcel,它允許您讀取和寫入 Excel 文件。 在這里下載。

$objReader = PHPExcel_IOFactory::createReader($fileType);
$objPHPExcel = $objReader->load($dirpath .'/'. $fileName); 
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('C3', 'some text here');
// Write the file
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $fileType);
$objWriter->save($dirpath .'/'. $fileName);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM