von simon » Di 10 Dez, 2002 09:08
Tag,
also wenn deine csv datei so aussieht
vorname,nachname,foobar,
peter,pan,foo
clark,kent,bar
Bat,Man,yo
kannst du ganz einfach das machen :
<?
$file = "datei.csv";
$delimiter = ",";
$fp = fopen($file, "r");
$firstline = fgets($fp, 128);
$data = explode($delimiter, $firstline);
echo "<table border="1">";
echo " <tr>";
foreach($data as $value) {
echo "<td>$value</td>";
}
echo "</tr>";
while(!feof($fp)) {
$buf = fgets($fp, 128);
$buf_data = explode($delimiter, $buf);
echo "<tr>";
foreach($buf_data as $value) {
echo "<td> $value </td>";
}
echo "</tr>";
}
?>