I would like to detect all the elements insides a parent element and still check if the child has child elements and detect them also.
For Example:
<div id="first">
<div id='second1'></div>
<div id='second2'>
<div id='third1'></div>
<div id='third2'>
<div id='fourth1'></div>
<div id='fourth2'></div>
</div>
<div id='third3'></div>
</div>
<div id='second3'></div>
<div id='second4'></div>
</div>
I want to know the list of all the id inside the #first and check each child if it has its child and keep this on going until I have complete list of all element.
I want this list in an array kinda in this pattern
array (
"body"=> {
"first" => "second1", "second2" .............
}
);