Wrapper DOMDocument简单包装器-如何调整appendChild的左侧
构建一个非常简单的文档包装器Wrapper DOMDocument简单包装器-如何调整appendChild的左侧,wrapper,domdocument,php-7.3,Wrapper,Domdocument,Php 7.3,构建一个非常简单的文档包装器 $this->xml->appendChild($this->tempName); 目前,该用法仅用于创建元素及其值并将其附加到已定义的父元素 $this->xml->appendChild($this->tempName); 问题:是否可以替换DOMDocument命令的文本 $this->xml->appendChild($this->tempName); 想要的结果:body标记应该附加html标记
$this->xml->appendChild($this->tempName);
目前,该用法仅用于创建元素及其值并将其附加到已定义的父元素
$this->xml->appendChild($this->tempName);
问题:是否可以替换DOMDocument命令的文本
$this->xml->appendChild($this->tempName);
想要的结果:body标记应该附加html标记
$this->xml->appendChild($this->tempName);
计划解决方案:
我需要appendChild中的“xml”能够被传入的变量$appendTo重放
$this->xml->appendChild($this->tempName);
Run.php
$this->xml->appendChild($this->tempName);
<?php
include 'logics.class.php';
$build = new Logics();
$build->createDoc();
$build->BuildElement('html', 'Ericsson', 'xml');
$build->BuildElement('body', 'Nokia', 'html');
$build->printDocument();