1. Go to this page and download the library: Download thapp/xmlbuilder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
thapp / xmlbuilder example snippets
use Thapp\XmlBuilder\XmlBuilder;
use Thapp\XmlBuilder\Normalizer;
$data = array(
'foo' => 'bar',
'node' => array(
'@attributes' => array(
'date' => '2013-06-06'
), 'some string'
);
);
$xmlBuilder = new XmlBuilder('data');
$xmlBuilder->load($data);
// createXML accepts a boolean value weather to return a string or a DOMDocument
// Set it to `false` if you want to retreive a DOMDocument instead.
echo $xmlBuilder->createXML(true);