php: replace text in xml doc
php: replace text in xml doc
Out of context: Reply #23
- Started
- Last post
- 27 Responses
- felizfeliz0
ok.. finally got the answer thanks to some help:
http://www.phpbuilder.com/board/…
<?php
$dom = new DOMDocument();
$dom->load('test.xml');$nodes = $dom->getElementsByTagName('leaf...
foreach($nodes as $n) {
$n->firstChild->nodeValue = 'Goodbye';
}
$dom->save("test.xml");
echo $dom->saveXML();
?>