HI, i am working on a project that includes HTML parsing, I want to parse the contents of a certain <div> tag. I have a parsing function to return the text between two strings using PHP functions, the problem is that inside that <div> there is another <div>
<div class=anything>
...
...
<div>
...
</div>
...
</div>
so if I write
return_between("<div id=anything" , "</div>")
that will return the till the end of that inside div, becouse if the first closing div the program finds, not the closing of the main div. so i think that the solution lies in regex, could anyone give me an idea of how to write that expression, since i am not well trained on them.
Thank You !