i want to tak a text file which is a table and take the contents of each sell and add to a database
here is what i have:
// open the text file and read the entire file into $filegets.
$handle = @fopen('mytextfile.txt', "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
$filegets = $filegets . $buffer;
}
fclose($handle);
}
// extract from start of table to close of table
$start = "<table border=0>";
$end = "</table>";
$tmpget = explode($start,$filegets);
$result = explode($end,$tmpget[1]);
echo "<table>";
echo $result[0];
echo "</table>"
// this is what i get:
<table>
<tr>
<td class=black9>Year</td>
<td class=black9>Team</td>
<td class=black9>Name</td>
</tr>
<tr>
<td class=black9>2005</td>
<td class=black9>NYY</td>
<td class=black9>Jeter</td>
</tr>
<tr>
<td class=black9>2005</td>
<td class=black9>BOS</td>
<td class=black9>Ortiz</td>
</tr>
</table>
so i want to now, instead of showing the results as a table, i want to make into an array for each 'table row' and then i can add to a database.