Possible Duplicate:
Best methods to parse HTML with PHP
So I have a ton of entries in my database where lists where entered, but they're not real lists and i need to convert them to actual lists.
Here's what I have:
Other HTML data here.
<p>ñ Line of data</p>
<p>ñ Another line of data</p>
<p>ñ Yet another line of data</p>
<p>ñ Still more data</p>
More HTML data here.
Needs to change to:
Other HTML data here.
<ul>
<li>Line of data</li>
<li>Another line of data</li>
<li>Yet another line of data</li>
<li>Still more data</li>
</ul>
More HTML data here.
It doesn't have to be formatted like that, could just be all smashed together. I don't care.
Thanks.
Forgot to mention there is HTML data on both sides of the would be list.
Also I've got the SimpleDOM parser. Not really interested in getting another one, but if there's a really easy one to use that would take care of this it would be helpful.
Thanks, again.
\n" . preg_replace('~- $1
\n", $content) . "
\n";` – NullUserException Sep 02 '11 at 14:46ñ *(.*?)
~', "\t