2
0

remove array outputs and add confirmation

This commit is contained in:
cwikladaniel
2025-12-11 11:40:54 +01:00
parent a1040bd5db
commit 576d664240

View File

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