Wednesday, 14 November 2018

php - Parsing HTML element into parts

I'm trying to parse the following code:






Essentially what I need is:




Array
(
[0] => [1] => border="0"
[2] => cellpadding="0"
[3] => cellspacing="0"
[4] => height="100%"
[5] => width="100%"
[6] => id="bodyTable"

[7] => style="table-layout: fixed;max-width:100% !important;width: 100% !important;min-width: 100% !important;
)


However when doing this with a simple explode(" ", $str); I'm getting the "style" split up too, is there a simple way to parse this and loop through it?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...

Blog Archive