Recommend this page to a friend! |
Classes of Gavin Gordon Markowski | Helphp PHP Class Generator | vendor/spatie/array-to-xml/README.md | Download |
|
DownloadConvert an array to xmlThis package provides a very simple class to convert an array to an xml string. PostcardwareYou're free to use this package (it's MIT-licensed), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using. Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium. The best postcards will get published on the open source page on our website. InstallYou can install this package via composer.
Usage
After running this piece of code
Optionally you can set the name of the rootElement by passing it as the second argument. If you don't specify this argument (or set it to an empty string) "root" will be used.
By default all spaces in the key names of your array will be converted to underscores. If you want to opt out of this behaviour you can set the third argument to false. We'll leave all keynames alone.
You can use a key named
This code will result in:
If your input contains something that cannot be parsed a Testing
ContributingPlease see CONTRIBUTING for details. SecurityIf you discover any security related issues, please email freek@spatie.be instead of using the issue tracker. CreditsLicenseThe MIT License (MIT). Please see License File for more information. |