Simplest XML Node Editor for PHP -


could please provide simplest/shortest code can edit values within xml node? have been searching hours , errors , failures. need can node (/node/node1/node2) , edit contents within it. using php-5. thanks

edit: lets have xml file:

<node>   <node2>     content   </node2> </node> 

what need change value of <node2> "content" else.

simplexml

$doc = simplexml_load_file('http://example.com/example.xml');  // note simplexmlelement root node, ie <node> $doc->node2 = 'new content';  $doc->asxml('new-filename.xml'); // note, saves locally // or $xmlstring = $doc->asxml(); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -