kukipei Posted August 2, 2008 Share Posted August 2, 2008 Hi to all! I am using this code: header('Content-type: text/plain'); $doc = new DOMDocument(); if (!$doc->loadHTML("gfd")) { echo "ERROR LOADING HTML STRING"; exit(); } $output = $doc->saveHTML(); echo $output; and here is output: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><p>gfd</p></body></html> Is it possible to get for output only this: gfd I do not need this additional lines: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><p> and </p></body></html> How can I achieve this? Best Regards Link to comment https://forums.phpfreaks.com/topic/117813-problem-with-dom/ Share on other sites More sharing options...
unkwntech Posted August 2, 2008 Share Posted August 2, 2008 echo "gfd"; ?? Link to comment https://forums.phpfreaks.com/topic/117813-problem-with-dom/#findComment-605978 Share on other sites More sharing options...
kukipei Posted August 2, 2008 Author Share Posted August 2, 2008 Yes but I need to use DOM Functions.(loadHTML and saveHTML). Link to comment https://forums.phpfreaks.com/topic/117813-problem-with-dom/#findComment-605980 Share on other sites More sharing options...
unkwntech Posted August 2, 2008 Share Posted August 2, 2008 Represents an entire HTML or XML document; serves as the root of the document tree <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body> All of the tags above are mandated by W3C specs. Of course the DOCTYPE may change. Link to comment https://forums.phpfreaks.com/topic/117813-problem-with-dom/#findComment-605981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.