I spent the better part of today trying to figure this out, and finally gave up and created some half-assed kludge using explode instead. I think this is an easy task, but it just beats the hell out of me. I got something sort of working with preg_match_all, but couldn't get the results I wanted. Anyone who answers please provide some explanation or pointers? Thanks.
here's an example string:
<DIV id=0 class=jt><SPAN class=T1001268k0>TRADE/SALE </SPAN><SPAN class=T1001268b> 1978 Dodge Motorhome 29 FT,<BR></SPAN></DIV>
<DIV class=j><SPAN class=T1001268b>440 engine, sleeps 6, owning, generator, A/C<BR></SPAN></DIV>
<DIV class=j><SPAN class=T1001268b>In storage for two years $3500.00.<BR></SPAN></DIV>
<DIV class=j><SPAN class=T1001268b>Or trade for small car. <BR></SPAN></DIV>
<DIV class=j><SPAN class=T1001268b>Call 760 724 7980 (760)724-7980 </SPAN></SPAN></DIV>
What I would like is for this to be broken at the inertsection of the <DIVs > and the following <SPAN> into an array so the parts line up something like this:
Array
(
[0] =><DIV id=0 class=jt>
[1] =><SPAN class=T1001268k0>TRADE/SALE </SPAN><SPAN class=T1001268b> 1978 Dodge Motorhome 29 FT,<BR></SPAN></DIV>
[2] =><DIV class=j>
[3] =><SPAN class=T1001268b>440 engine, sleeps 6, owning, generator, A/C<BR></SPAN></DIV>
[4] =><DIV class=j>
[5] =><SPAN class=T1001268b>In storage for two years $3500.00.<BR></SPAN></DIV>
.
.
.
etc
)
If you can explain to create any sort of array like this, I'll be grateful. Doesn't need to be in this exact structre; I'll work out the rest.
thanks.
Part 2: if anyone can explain the difference between preg and ereg I will be undying grateful.