PHP : Creating image from html table

前端 未结 4 1277
一向
一向 2020-12-18 17:48

Can I get some sample code in PHP for converting an html table to image form(.gif,.jpg or any format)? I am using XAMPP on Windows.
Yes, the table is coming from the da

4条回答
  •  Happy的楠姐
    2020-12-18 18:21

    At first glance, that's quite a tall order. Here are some pointers:

    • You'll probably want to get cosy with the GD library

    Where is this table coming from? If it's coming from your database originally, this would be easier to work with. Otherwise...

    • You'll need to get the remote page (I recommend curl)
    • Then you'll need to extract the table data

    The complexity of the second step really depends on how similar each page and table is going to be. Regex is probably going to be useful though.

    Hope this helps,

    Tom

提交回复
热议问题