Hello,
I'm having difficulties parsing/reformatting some lines from an HTML file. The file contains entries between markers as this:
<!-- ###LISTING### -->
<p>2008-03-17 > People ><br /><a href="/1970/people/smith.html">Peter Smith</a></p><hr />
<p>2008-03-15 > Employes ><br /><a href="/1970/people/fleming.html">John Fleming</a></p>
<p>2008-03-15 > Workers ><br /><a href="/1970/people/hamilton.html">Nill Hamilton</a></p><hr />
<!-- ###LISTING### -->
I need to parse/reformat the lines as follows:
<dl>
<dt>2008-03-17</dt><dd><a href="/1970/people/smith.html">Peter Smith</a></dd>
<dt>2008-03-15</dt><dd><a href="/1970/people/fleming.html">John Fleming</a></dd>
<dt>2008-03-15</dt><dd><a href="/1970/people/hamilton.html">Nill Hamilton</a></dd>
</dl>
So far the following code returns all lines between markers:
Note: Marker = <!-- ###LISTING### -->
function getHTMLFile () {
$gotit = preg_match('/' . $this->config['Marker'] . '([\d\w\s\S]*)' . $this->config['Marker'] . '/',$theFile,$matches);
return $matches[1];
Any help will be appreciated.
Thank you