PHPExcel CSV to XLSX

后端 未结 1 1184
误落风尘
误落风尘 2021-01-14 23:01

I have a problem converting file feom CSV to XLSX format:

Index.php



    
            


        
相关标签:
1条回答
  • 2021-01-14 23:37

    The "default" separator for reading a CSV file in PHPExcel is a comma (,). Your CSV file is using something other than a comma - perhaps a tab ("\t"), which is also commonly used for such files).

    If the values isn't a comma (and we can't tell from an image of the file viewed in MS Excel) then you have to tell PHPExcel explicitly what that separator is before loading.

    e.g.

    $objReader->setDelimiter("\t");
    
    0 讨论(0)
提交回复
热议问题