Export data to XML with sepa-xml-php

425 views Asked by At

please I need help I'm trying to create a SEPA XML file so I downloaded the sepa-xml with coenter image description heremposer in my project then I make the same code in the documentation to test if work or not so when I enter image description hereadded the code and generate the file I get an empty file. but when I dump the variable I get a result .

I get this page

1

There are 1 answers

0
Kvvaradha On

I referred here. Looks like you need to download the generated xml code. [Git link][1]. Code will be like this.

 header('Content-disposition: attachment; filename="newfile.xml"');
    header('Content-type: "text/xml"; charset="utf8"');
    echo $directDebit->asXML();
    exit;

In this case the generated code will be saved as newfile.xml and download the file automatically. Hope it solves your problem [1]: https://github.com/php-sepa-xml/php-sepa-xml/blob/master/doc/direct_debit.md