Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wrapper DOMDocument简单包装器-如何调整appendChild的左侧_Wrapper_Domdocument_Php 7.3 - Fatal编程技术网

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();