$filename="filename.csv";
$delimiter=",";
$rowlenght=500
if(!file_exists($filename) || !is_readable($filename))
return FALSE;
$header = NULL;
$data = array();
if (($handle = fopen($filename, "r")) !== FALSE)
{
while (($row = fgetcsv($handle, $rowlenght, $delimiter)) !== FALSE)
{
if(!$header)
{
$header = $row;
}
else
{$data[] = array_combine($header, $row);
}
}
fclose($handle);
}
// read array data
foreach($data as $obj){
$status = $obj->ColumnName;
print "$status";
}
$delimiter=",";
$rowlenght=500
if(!file_exists($filename) || !is_readable($filename))
return FALSE;
$header = NULL;
$data = array();
if (($handle = fopen($filename, "r")) !== FALSE)
{
while (($row = fgetcsv($handle, $rowlenght, $delimiter)) !== FALSE)
{
if(!$header)
{
$header = $row;
}
else
{$data[] = array_combine($header, $row);
}
}
fclose($handle);
}
// read array data
foreach($data as $obj){
$status = $obj->ColumnName;
print "$status";
}
0 comments:
Post a Comment