PHP library for creating/manipulating fixed-width text files

前端 未结 7 1429
走了就别回头了
走了就别回头了 2021-02-05 09:27

We have a web application that does time-tracking, payroll, and HR. As a result, we have to write a lot of fixed-width data files for export into other systems (state tax filing

7条回答
  •  没有蜡笔的小新
    2021-02-05 09:43

    I'm sorry i cant help you with a direct class i have seen some thing that does this but i can't remember where so sorry for that but it should be simple for a coder to build,

    So how i have seen this work in an example:

    php reads in data

    php then uses a flag (E.G a $_GET['type']) to know how to output the data E.G Printer, HTML, Excel

    So you build template files for each version then depending on the flag you load and use the defined template, as for Fixed Width this is a HTML thing not PHP so this should be done in templates CSS

    Then from this you can output your data how ever any user requires it,

    Smarty Templates is quite good for this and then the php header to send the content type when required.

提交回复
热议问题