所以我想从属性是特定值的XML字符串中删除子元素。如何从XML树中删除元素,其中属性是简单XML中的特定字符串PHP
例如:
<xml>
<note url="http://google.com">
Values
</note>
<note url="http://yahoo.com">
Yahoo Values
</note>
</xml>
那么我将如何删除与属性http://yahoo.com作为字符串的URL的说明节点?
我试图做到这一点在PHP中简单的XML
哦,也是我在加载它作为与SimpleXML_Load_String功能像这样的XML对象:
$notesXML = simplexml_load_string($noteString['Notes']);
类似的问题:http://stackoverflow.com/questions/262351/remove-a-child-with-a-specific-attribute-in-simplexml-for-php –
你从哪里弄来'$ noteString从? – krummens