all i want to do is to extract things out of the html code and and assign it to a variable and then insert it into a database. I know how to insert but i dont' know how to extract the information i need from that html code i gave.
I tired using preg_match to find the code but i dont' know which statement to use to extract the information i want. I have many html file with the code shown and i am using code to read all files and i'm trying to extract information from all files and insert to database.
I was able to do this so far:
$html = preg_replace("'<table[>]?>.?<a href=(.?)'si","<a href=",$data);
$html = preg_replace("'</tr>.?</table>'si","",$html);
$html = preg_replace("'<td[>]*?>'si","",$html);
which now leaves with the following:
<a href="A-Blast/index.html" onClick="opengame(this.href,350,390); return false"><img src="A-Blast/a-blast.gif" width="73" height="50" border="1" style="border-color:#000000" alt="Go play A-Blast"></a></td>
<span class="raquo">»</span> <a href="A-Blast/index.html" onClick="opengame(this.href,350,390); return false">
A-Blast</a><br>
<span class="I-desc">Category: Puzzle</span></td>
<a href="A-Blast3d/index.html" onClick="opengame(this.href,550,403); return false"><img src="A-Blast3d/a-blast3d.gif" width="73" height="50" border="1" style="border-color:#000000" alt="Go play A-Blast3d"></a></td>
<span class="raquo">»</span> <a href="A-Blast3d/index.html" onClick="opengame(this.href,550,403); return false">
A-Blast3d</a><br>
<span class="I-desc">Category: Adventure</span></td>
i just need to extract what i want and this i need help with.