function createxmlele($data, $name='root', &$doc=null, &$node=null){if ($doc==null){$doc = new DOMDocument('1.0','UTF-8');$doc->formatOutput = TRUE;$node = $doc;}if (is_array($data)){foreach($data as $var=>$val){if (is_numeric($var)){$this->createxmlele($val, $name, $doc, $node);}else{if (!isset($child)){$child = $doc->createElement($name);$node->appendChild($child);}$this->createxmlele($val, $var, $doc, $child);}}}else{$child = $doc->createElement($name);$node->appendChild($child);$textNode = $doc->createTextNode($data);$child->appendChild($textNode);}if ($doc==$node){return $doc;}}
Shopify, Shopify Apps, Magento, WordPress, Codeigniter, Joomla, Big Commerce | PHP
Showing posts with label Multidimensional. Show all posts
Showing posts with label Multidimensional. Show all posts
Thursday, 4 June 2020
How to convert a multidimensional Array To XML in PHP
Friday, 30 August 2019
How to create multidimensional array in jQuery | Javascript
var jaydip = {};
for(var i=0; i < items.length; i++){
jaydip[items[i]] = items[i]+'123';
}
console.log(jaydip);
alert(JSON.stringify(jaydip));
Subscribe to:
Posts (Atom)