Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 245
rsk82 Avatar asked Nov 25 '25 18:11

rsk82


1 Answers

Use a DOM parser like SimpleXML to split the HTML code into nodes, and walk through the nodes to build the array.

For broken/invalid HTML, SimpleHTMLDOM is more lenient (but it's not built in).

like image 187
Pekka Avatar answered Nov 28 '25 07:11

Pekka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!