Hi all,
Is there any way to remove a non-unique* *node using SimpleXML?
For example, let's say I have:
$myXML = <<ENDXML
<database ...>
<table name='one'>
...
</table>
<table name='two'>
...
</table>
<table name='three'>
...
</table>
</database>
ENDXML;
So I want to do...
$xmlDatabase = new SimpleXMLElement($myXML);
foreach ($xmlDatabase as $oneTable)
{
if ($oneTable['name'] == 'two')
{
/// ---- HERE I WANT TO DELETE THE $oneTable NODE
unset($oneTable); // <-- and this doesn't work...
}
}
any ideas?