i haven't started any coding just yet however is there anyone here who have made a code that can generate an xml file from a csv file? can you share the code with so i can study it? i have ideas on how to approach this problem but i just though i'd take my chances that someone out there might have already done it. i'll appreciate any help on this matter. thanks in advance!
help: php code that can generate an xml file from a csv file
Moderator: General Moderators
help: php code that can generate an xml file from a csv file
im not sure if this is the right section for my question, however here goes..
i haven't started any coding just yet however is there anyone here who have made a code that can generate an xml file from a csv file? can you share the code with so i can study it? i have ideas on how to approach this problem but i just though i'd take my chances that someone out there might have already done it. i'll appreciate any help on this matter. thanks in advance!
i haven't started any coding just yet however is there anyone here who have made a code that can generate an xml file from a csv file? can you share the code with so i can study it? i have ideas on how to approach this problem but i just though i'd take my chances that someone out there might have already done it. i'll appreciate any help on this matter. thanks in advance!
can be as simple asdepends on exactly what you're trying to achieve.
Code: Select all
...
$elementnames = array('one', 'two', 'three', 'four');
...
$record = $dom->createElement('row');
foreach($row as $key=>$val) {
$element = $dom->createElement($elementnames[$key], $val);
$record->appendChild($element);
}
$dom->documentElement->appendChild($record);
...