Home  >  Article  >  Backend Development  >  php创造xml并格式化输出

php创造xml并格式化输出

WBOY
WBOYOriginal
2016-06-13 12:43:451563browse

php创建xml并格式化输出
DOMDocument创建xml,设$dom->formatOutput = true;但创建出来的只有根节点下的第一级节点才被格式化,而第一级节点下的子节点并没有(图1)。我想要的是整个xml文件都格式化输出(图2)
图1:

图2:

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn