hi
I am making a script to extract data from a table from a website using explode function and then insert the data into the database.
I have stuck with foreach loop, this is how it looks:
$table_data = explode('<table cellspacing="1" cellpadding=1" width="90%" border="0" bgcolor="#EFEEEE">', $data);
$end_table= explode("</table>", $table_data[1]);
$raw = explode('</tr><tr bgcolor=ffffff>
<td align="center" bgcolor=ffffff>', $end_table[0]);
foreach( $raw as $key ){
$final = $key;
}
when I try to print the value of $final outside the loop I get only the last raw. and when I add a dot (.) before the equal sign of the $final variable like this ($final .= $key) the data keeps increasing. How can I get the value of the loop outside it in order to insert in the database, or how can I get not to increase every time it loops.