开发者

Read Excel file using PHP

I need to read the contents of a XLS file which has 10 columns and one of which contains the flo开发者_如何转开发at vales like(10.5, 78.88).

However when I try to read the values I get values like (105, 7888), please help me in this regard with any example code or any valid solution.


You could try to follow the tutorial @ http://www.ibm.com/developerworks/opensource/library/os-phpexcel/index.html to see what you are doing differently to get your current code to work.

Hope that helps.


You can use PHPExcel that allows you to both read and write Excel file. Download it here.

$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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜