Jump to content

problems removing elements from a DOMdocument


neon Source

Recommended Posts

The issue is that for some reason i can't figure out it only removes precisely half of the elements in the DOMNodelist.

 

$deleteList = $doc->getElementsByTagName('photo');
foreach ($deleteList as $deleteEntry) {
  $root->removeChild($deleteEntry);
}

 

it seems that the loop doesnt run for all the entries in the list.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.