I have a string that contains the following:
[CODE]<div class=”listing”>
<a name=”something”></a>
SOME STUFF HERE
</div>
<div class=”listing”>
<a name=”something”></a>
SOME STUFF HERE
</div>
//more divs of the same type here
I am trying to match each individual div using preg_match_all, but my regular expression:
<div class=”listing”>[s]*<a name[/s/S]
returns the ENTIRE html code (since it begins with div class=”listing” and ends with </div>
So, I tried to use the following so that it would return a match that did NOT contain </div> in it:
<div class=”listing”>[s]*<a name[^</div>]
but that results in NO matches ?
How can I get each <div> separated into an array?