"; /*loop through the headers outputting them into their own cells*/ while($i<$numheaders){ $headers = str_replace("\"", "", $headers); echo "".$headers[$i].""; $i++; } echo ""; $y = 1; /*Output the data, looping through the number of lines of data and also looping through the number of cells in each line, as this is a dynamic number the header length has to be reread.*/ while($y<$numlines){ $x=0; if ($y%2==0) { echo ""; } else { echo ""; } while($x<$numheaders){ $fields = explode($sep, $lines[$y]); $fields = str_replace("\"", "", $fields); echo " ".$fields[$x]." "; $x++; } $y++; echo ""; } /*close the table.*/ echo ""; } ?>