I have a string like this:
$string = "<div class="legenda">Legenda</div>
<li><a href="link2">02</a></li>
<li><a href="link3">03</a></li>
<li><a href="link4">04</a></li>
<div class="dublado">Dublado</div>
<li><a href="link1">01</a></li>
<li><a href="link2">02</a></li>
<li><a href="link3">03</a></li>
";
I wanted some help to manipulate and it would be shown that way
Legenda
1
1
1
Dublado
1
1
1
In the case, show only what is inside <div class="legenda">
of <a>
and other div .
Does anyone have a solution?