Skip to content

harriperhana/array2xml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Usage

No further introduction is needed here. This...

$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><xml/>');

array2xml([
    "element" => "content"
], $xml);

...becomes into this...

<?xml version="1.0" encoding="UTF-8"?>
<xml>
  <element>content</element>
</xml>

See the examples for the eureka effect.

Why?

Extensible Markup Language was launched in 1998, and it's still a huge pain in most people's arseholes, especially when you need to compose 'em at the programming level. This function allows you to easily output valid XML from a multidimensional array without feeling dizzy when going into the deep end.

If you don't understand why this exists then you clearly haven't dealt with complex structures enough and therefore it's not meant for you.

About

Convert multidimensional array into XML document

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages