madcrazy1 Posted September 15, 2011 Share Posted September 15, 2011 <?php $var=$_POST["fname"]; $xmlDoc = new DOMDocument(); $xmlDoc->loadXML($var); $root = $xmlDoc->documentElement; $elms = $root->getElementsByTagName("*"); foreach ($elms as $item) { // gets the name and the value of each $item $tag = $item->nodeName; $value = $item->nodeValue; // outputs the $tag and $value echo $tag. ' = '. $value . ''; I want to use the code above to get all the xml files parent and child names and values and get them into the database. is this going to work? thanks in advance Link to comment https://forums.phpfreaks.com/topic/247166-need-to-finish-php-code-to-fill-db/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.