I'm trying to extract content of a div with PHP, independent of a class name and other parameters.
What I need is, I have multiline, single line, multiple parameter div such as
<div class="my-class additional-class"><div class="my-class2">
<div class="my-class"></div>
</div>
</div>
and I would like to get all the content of the first div, without the first div.
<div class="my-class2">
<div class="my-class"></div>
</div>
Normally, I'd guess
<div.*>(.*)<\/div>/mU
should have worked but I'm not sure why it doesn't.
I've came across this one
(?s)(?<=<div\sclass="test">\n).*(?=<\/div>)
which works with a class name test
but I couldn't make it work as
(?s)(?<=<div.*>\n)(.*)(?=<\/div>)
Any help is appreciated.
Thank you,