dongpanbo4727 2016-02-04 18:31
浏览 18
已采纳

如何在没有phpexcel的情况下从php制作excel?

Well I have been searching for a while (google,here & other pages) and I haven't found a solution for me.

I have a php file that makes a table from querys, but I need to make an xls file and send it via email, my issue is, I need this to be automatic without force-download header.

I read about phpexcel but if I use that library, I need to remake whole php code.

I tried using part of this answer: https://stackoverflow.com/a/2512686/5586647

Is there a way to accomplish this without PHPExcel?

  • 写回答

1条回答 默认 最新

  • dongsilu2237 2016-02-04 18:37
    关注

    You can create a csv by putting your data into a variable and then adding a "\t" after each column and a "" when you want to end a row. Write that string out to a file, then send an email out with that file as the attachment. I suggest phpmailer since it makes doing file attachments in emails very easy.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line