DOMDocument { DOMComment createComment ( string data )} This function creates a new instance of class DOMComment. 本節(jié)點(diǎn)不會(huì)出現(xiàn)在文檔中,除非是用例如 DOMNode->appendChild() 函數(shù)來(lái)將其插入。 參數(shù) data The content of the comment.
domelement DomDocument->document_element ( void ) This function returns the root element node of a document. The following example returns just the element with name CHAPTER and prints it. The other node -- the comment -- is not returned. 例子1. Retrieving root element...
DOMDocument { bool loadHTMLFile ( string filename )} The function parses the HTML document in the file named filename. Unlike loading XML, HTML does not have to be well-formed to load. This function may also be called statically to load and create a DOMDocument object. The static ...
$text=$doc->create_text_node("This is the title"); $text=$title->append_child($text); echo"<PRE>"; echohtmlentities($doc->dump_mem(true)); echo"</PRE>"; ?> 注:The first parameter was added in PHP 4.3.0. See alsodomdocument_dump_file(), anddomdocument_html_dump_mem()....
DOMDocument->loadXML() -- Load XML from a string 說(shuō)明 classDOMDocument{ boolloadXML( string source [, int options] ) } Loads an XML document from a string. This method may also be called statically to load and create aDOMDocumentobject. The static invocation may be used when noDOMDocument...