Home > Backend Development > PHP Tutorial > 关于php dom能不可不用DOMDocument->load 直接读取写在当前php的xml

关于php dom能不可不用DOMDocument->load 直接读取写在当前php的xml

WBOY
Release: 2016-06-13 12:59:09
Original
1067 people have browsed it

关于php dom能不能不用DOMDocument->load 直接读取写在当前php的xml
请问大家php dom能不能不用DOMDocument->load 读取在其他位置的文件,而直接读取以string写在当前php文件里的xml, 还有 有没有方法直接在网页打印出DOMDocument中的xml内容  而不用DOMDocument->save 保存 到另一个文件当中 。 没有找到方法,求大家能告诉我一下。谢谢
------解决方案--------------------
手册:
class DOMDocument { 
  bool loadXML ( string source [, int options] )
}
即 DOMDocument->loadXML('....')

DOMDocument->save 无论是否有要保存的文件名作为参数,都将返回相应的 XML 串
echo DOMDocument->save()

Related labels:
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