<table border=1>
<tr>
<td>thread started</td><td> </td><td>goto new post</td><td>topic title</td><td>author</td><td>replies</td><td>views</td><td>date</td><td>last poster</td><td>goto last post</td>
</tr>
</table>
this little code bit is the format of a line of a vbb forum.
i want to get only a few items from each row of the forum. i just want the topic title, the author and the number of replies.
so far, ive come up with the code below. what you dont see if that it gets the page from curl, then what you do see if that it writes it to a file, reads the file and uses preg_match to find the topic (based on finding the url that contains the "showtopic.php?t=" string. i do that for finding the member who posted last as well, by looking for the "member.php" string.
now the problem..
the problem is that the array that contains the topic and the array that contains the author dont match.
somebody suggested to me that i match the whole table row that has the info i want in it, but i cant figure out a refex that will work. is that the best way? or is there a better or diffrent way? any help is appreciated!
$filename = "./og.txt";
$og = fopen("$filename", "r+");
fwrite($og, $result);
fclose($og);
$handle = fopen($filename, "r");
$contents = fread($handle, 1000000000);
fclose($handle);
$thread_pat = "~showthread\.php\?t=[^>]*>(.+?)</a>~si";
$member_pat = "~member\.php[^>]*>(.+?)</a>~si";
preg_match_all($thread_pat, $contents, $threads);
preg_match_all($member_pat, $contents, $members);
echo $threads[0][18];
echo $members[0][18];
i