validate csv file header

 <?php


$files = glob("$PathToCreate$version/*.csv");

foreach($files as $file) {

if (($handle = fopen($file, "r")) !== FALSE) {
echo "<b>Filename: " . basename($file) . "</b><br><br>";
while (($data = fgetcsv($handle, 4096, ",")) !== FALSE) {
echo implode("t", $data);
}
echo "<br>";
fclose($handle);
} else {
echo "Could not open file: " . $file;
}

}

?>

Leave a Comment

Your email address will not be published. Required fields are marked *