How do I parse the following
{menu id="123"}
Random text.
{menu-item id="123"/}
Random text.
{menu-item id="123"/}
{/menu}
into an array, like such
Array(
[menu] => Array(
[id] => 123
[children] => Array(
[menu-item] = Array(
[id] => 123
)
[menu-item] = Array(
[id] => 123
)
)
)
)
It's similar to HTML. Tags that do not have a closing tag are self-closed.