开发者

Handling office open xml (xlsx) documents with PHP

开发者 https://www.devze.com 2022-12-08 23:26 出处:网络
I need to create sort of a php based Excel (xslx) handling component. I figured that there are several open source projects around which are into this. Does anyone has particular

I need to create sort of a php based Excel (xslx) handling component. I figured that there are several open source projects around which are into this. Does anyone has particular experiences / advice on this for me? I.e. which one to go with, which on开发者_开发百科e is to be avoided?

I tend to go with PHP-Excel.

thx in advance for your thoughts...

K


It depends on what you want to accomplish. If you need to precisely generate an excel file, such a package is the way to go. Using it, you can specify the spreadsheet as much as you like/need.

If you need to open a file and search-and-replace in it, usually such packages are unable to do so. Then you had better manually modify the file:

  1. Open it as a zip
  2. read the structure
  3. modify the xml-files
  4. save them back to the zip
  5. Rename the zip to .xlsx

Sounds tedious, but is a tremendous learning experience and gives you even more control over the file.


I used PHP-Excel for many times. One of authors have some examples on blog, sorry only in czech.

0

精彩评论

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