create and save xml file #188
robertotnoya
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I really enjoyed your source about generate a XML file.
I've try successfully!
Do you know how can I save the result xml in a file?
I'd like to create a file like "clients.xml" and move it to Storage. But the xml file dont' break line.
$array => date from database.
$result = ArrayToXml::convert($array, [
'rootElementName' => 'Carga',
'_attributes' => [
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
],
], true, 'UTF-8');
Storage::put('xml/text.xml', nl2br($result));
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions