remove array outputs and add confirmation
This commit is contained in:
@@ -27,8 +27,6 @@ if(!$fp){
|
||||
$header_array =fgetcsv($fp, 0, ";");
|
||||
|
||||
|
||||
print_r($header_array);
|
||||
|
||||
// CREATE XML DOM
|
||||
$xmlDoc = new DOMDocument("1.0", "utf-8");
|
||||
$xmlDoc->formatOutput=true;
|
||||
@@ -55,7 +53,6 @@ while(($row_array = fgetcsv($fp, 0, ";")) !== false){
|
||||
|
||||
// get current collumn
|
||||
$column = $header_array[$i];
|
||||
echo "$row_array[$i]<br>";
|
||||
|
||||
// create a new element with name of column and row data
|
||||
$xmlSchuelerDaten = $xmlDoc->createElement($column, $row_array[$i]);
|
||||
@@ -66,5 +63,7 @@ while(($row_array = fgetcsv($fp, 0, ";")) !== false){
|
||||
}
|
||||
|
||||
// Save whole XML file
|
||||
$fileXml = "e2fi2.xml";
|
||||
$xmlDoc->save(__DIR__ . "/$fileXml");
|
||||
$fileXML = "e2fi2.xml";
|
||||
$xmlDoc->save(__DIR__ . "/$fileXML");
|
||||
|
||||
echo "CSV FILE ($fileCSV) CONVERTED TO XML ($fileXML) AND SAVED";
|
||||
Reference in New Issue
Block a user