PHP的 DOMDocument 遇到的小问题

WBOY
Release: 2016-06-23 14:14:26
Original
807 people have browsed it

PHP的 DOMDocument
怎么在根节点前插入数据?
比如我要在前插入:


结果为:



  title


回复讨论(解决方案)

urlset也算是一个节点,你创建了这个节点,然后找哪个父节点去append?

file_get_contents+ file_put_contents 

file_get_contents+ file_put_contents 

这样操作当然没问题。就是不知道PHP的 DOMDocument可不可以。

urlset也算是一个节点,你创建了这个节点,然后找哪个父节点去append?

也许我写的那个不是XML的标准文档。看来我理解错了。看XML去。

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template