I am trying to parse a html document and get a particular data out of it and save it into mysql table. But I am stuck in one of the scenerios and want help in it,
I have a html document as given below..
<div class="block">
<div class="author">M.K.jack</div>
<a href="x.html">maths</a>
<a href="y.html">science</a>
<a href="z.html">english</a>
<div class="author">samuels</div>
<a href="a.html">maths</a>
<a href="b.html">science</a>
<div class="author">edison</div>
<a href="h.html">maths</a>
<a href="g.html">science</a>
</div>
Now i want to parse and save it as a table as given below..
**id** **url** **title** **author**
1 x.html maths M.K.jack
2 y.html science M.K.jack
3 z.html english M.K.jack
4 a.html maths samuels
5 b.html science samuels
6 h.html maths edison
7 g.html science edison
In this you can see that the author div doesnt enclose the subject, but is there a way to parse in php where i can store the data in this manner.