Exporting data from php to excel

后端 未结 5 441
逝去的感伤
逝去的感伤 2020-12-08 22:23

I need to export data from php (data retrieved from mysql database) to excel. I\'m using Zend Framework. I need to do some changes to my data before exporting to excel. Actu

5条回答
  •  时光取名叫无心
    2020-12-08 22:45

    You can use CSV to make a importable format for excel. This is the simpliest way to do it.

    CSV looks like this :

    "my first cellcontent", "my second cell content", "my third cell content"
    "second line, first cell content", "etc", "etc
    

    Each row represents an Excel row, you put cell content between double quotes, and separated by commas. Be careful to \r\n if you've got some in your datas, it can break your CSV and create unwanted new lines.

提交回复
热议问题