简体   繁体   English

编辑XML文件并从PHP保存

[英]Edit XML File and Save it from PHP

I need to edit this XML file and update the values, and save to existing XML file. 我需要编辑此XML文件并更新值,然后保存到现有XML文件中。

<resources>
    <string name="application">generation</string>
    <string name="application2">generation2</string>
    <string-type name="type">single</string-type>
</resources>

I need to update the values, 'generation', 'generation2', 'single' from db. 我需要从db更新值“ generation”,“ generation2”,“ single”。 Thanks... hope a quick response. 谢谢...希望能尽快得到答复。 Thanks again. 再次感谢。

How to delete child nods??! 如何删除儿童点头??!

您应该查看DOMDocument ,它可以解析XML或HTML,对其进行修改,然后将修改后的版本导出回字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM