【发布时间】:2020-04-20 10:12:52
【问题描述】:
我遇到了以下问题,我有一个 import.xml,其中包含一个示例内容,例如
<abc></abc>
<lable_def name="Label" x="100" y="200" z="300"></label_def>
<abcd></abcd>
....
...
现在我想要以下内容:
if the tag is = <lable_def name"Label"
than delete X and Y Tags
and value of Z minus 6
and add the tag haschanged="1"
整个 XML 应该保存为 new.xml,其中包含所有原始内容,但有一些更改,例如:
<abc></abc>
<lable_def name="Label" z="294" haschanged="1"></label_def>
<abcd></abcd>
....
...
如何用 PHP 解决这个问题?
【问题讨论】: