Packy Posted December 7, 2007 Share Posted December 7, 2007 Simple problem, hope simple solution. How to edit element in XML file? Here what I have been trying... <?php $dom = new DOMDocument; $dom->load('XML/sample.xml'); if ($dom->getElementsByTagname('Static_IP')) { $Static_IP = $dom->getElementsByTagname('Static_IP'); $Static_IP_value = $Static_IP->item(0)->firstChild->nodeValue; print "IP address: $Static_IP_value"; $IPaddress =10.10.1.1; ???????????? How to add this variable into te element name Static_IP ???????????? $dom->formatOutput = true; $sample = $dom->saveXML(); $dom->save('XML/sample.xml'); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.