PHP Script to convert .CSV files to .XML

后端 未结 4 1944
抹茶落季
抹茶落季 2021-01-02 08:30

Just wondering if anyone can point me in the direction of some tips / a script that will help me create an XML from an original CSV File, using PHP.

Cheers

4条回答
  •  粉色の甜心
    2021-01-02 08:52

    The code given above creates an XML document, but does not store it on any physical device. So replace echo $doc->saveXML(); with

    $strxml = $doc->saveXML();
    $handle = fopen($outputFilename, "w");
    fwrite($handle, $strxml);
    fclose($handle);
    

提交回复
热议问题