Skip the first row, fill in the destination parameter

This commit is contained in:
Oliver Davies 2015-08-07 01:54:41 +01:00
parent 4f03c457db
commit 1211f0d0a5

View file

@ -17,14 +17,18 @@ $row = 1;
if (($handle = fopen($filename, 'r')) !== FALSE) { if (($handle = fopen($filename, 'r')) !== FALSE) {
while (($data = fgetcsv($handle, filesize($filename))) !== FALSE) { while (($data = fgetcsv($handle, filesize($filename))) !== FALSE) {
var_dump($data[0]); if ($row === 1) {
continue;
}
$templateData = [ $templateData = [
'%DESTINATION%' => $destination, '%DESTINATION%' => $data[1],
]; ];
$output = strtr($template, $templateData); $output = strtr($template, $templateData);
file_put_contents("source/{$data[0]}.html", $output); file_put_contents("source/{$data[0]}.html", $output);
echo "Written to {$data[0]}.html\n";
$row++; $row++;
} }
} }