I want to create an Array like this:
"content" => [
[
"p" => true,
"text" => "Some nasty text"
],
[
"ul" => [
[
"top" => true,
"li" => true,
"text" => "firstElement"
],
[
"ul" => [
[
"li" => true,
"text" => "Nested Element"
],[
"ul" => [
[
"li" => true,
"text" => "Nested Element2"
]
]
]
]
],
[
"li" => true,
"text" => "elem"
],
]
]
by parsing a HTML page. I got the HTML as a string from another method. Is there any tool or algorithm out there i can use for this ? Also i want to be able to add soem special attribute to the first "ul" for example.
After getting the HTML in this Array form i want to run it through mustache.