|
Posted by James on 09/18/05 07:44
Hello everyone. I've been looking for examples on this:
http://www.php.net/manual/en/functi...-appenddata.php
but can't really find one. I've got a function that generates a return value
in HTML, and need to append that to the body tag of my document. So I've
captured the contents of the page with output buffering, and have loaded it
into the PHP DOM. I've isolated the body element:
,----[ php ]
$dom = new DomDocument;
$dom->LoadHTML($buffer);
$body = $dom->getElementsByTagName('body');
$body = $body->item(0);
`----
And want to do the following:
,----[ php ]
$body->appendData($html);
`----
Of course as the appendData method is a member of the DOMCharacterData
class, I get an error:
Fatal error: Call to undefined method DOMElement::appendData()
But how can I access the appendData() method to get the results I want?
Thanks everyone,
James
ps. This is my first post to a newsgroup... Sorry if I'm posting this
improperly or something.
Navigation:
[Reply to this message]
|