$doc = new domdocument('1.0');
// we want a nice output
$doc->formatoutput = true;
代码如下 | 复制代码 |
$root = $doc->createelement('book'); $root = $doc->appendchild($root); $title = $doc->createelement('title');$title = $root->appendchild($title); $text = $doc->createtextnode('this is the title'); echo "retrieving all the document: "; echo "retrieving only the title part: "; |
时间: 2024-10-13 13:19:40