Getting an element from PHP DOM and changing its value
问题 I'm using PHP/Zend to load html into a DOM, and then I get a specific div id that I want to modify. $dom = new Zend_Dom_Query($html); $element = $dom->query('div[id="someid"]'); How do I modify the text/content/html displayed inside that $element div, and then save the changes to the $dom or $html so I can print the modified html. Any idea how to do this? 回答1: Zend_Dom_Query is tailored just for querying a dom, so it doesn't provide an interface in and of itself to alter the dom and save it,