What is the fastest way to convert html table to php array?

前端 未结 6 1689
深忆病人
深忆病人 2020-12-21 08:52

are there build in functions in latest versions of php specially designed to aid in this task ?

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-21 09:09

    If you want to convert the html-description of a table, here's how I would do it:

    • remove all closing tags () ( http://php.net/manual/de/function.str-replace.php)
    • split string at opening tags (<...>) using a regular expression ( http://php.net/manual/en/function.split.php)

    You have to work out the details on your own, since I do not know if you want to handle different lines as subarrays or you want to merge all lines into one big array or something else.

提交回复
热议问题