PHP code example of zedisdog / array-into-xml-in-two-way
1. Go to this page and download the library: Download zedisdog/array-into-xml-in-two-way 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/ */
zedisdog / array-into-xml-in-two-way example snippets
$xml = new Array2XML('root_node_name', $version /*='1.0'*/, $encoding /*='utf-8'*/);
$xml->addNode($node_name,$arr,$parentId/*='root'*/);
echo $xml->saveXML();
$array = XML2Array::createArray($xml);
print_r($array);