Hi,»» »» Hi,
vielleicht tust Du Dir hiermit leichter: http://de2.php.net/manual/de/function.fgetcsv.php
Diese seite ist mir bekannt, dann macht meine klasse aber keinen sinn.
Doch, hab grade gesehen dass Du sie bereits nutzt. Probier das mal, ist allerdings nur schnell hingekritzelt:
<?php
class CSVrw {
function CSVrw() {
}
function CSVread($file_r) {
$this->file_r=$file_r;
$this->table=array();
$this->handle=fopen($this->file_r,"r");
while(($this->data=fgetcsv ($this->handle, 1000, ",")) !== FALSE ) {
$this->table[] = array();
foreach ($this->data as $val) {
$this->table[count($this->table) -1][] = $val;
}
}
//datei schliessen
fclose ($this->handle);
return $this->table;
}
}
$data = new CSVrw;
echo "<pre>";
print_r($data->CSVread("text.csv"));
echo "</pre>";
?>
Gruesse, Joachim
Am Ende wird alles gut.