You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Daniele Orlando edited this page Feb 21, 2016
·
2 revisions
Removing a node is just a matter of querying.
$food->remove('//egg'); // Removes all the eggs.
Which is the same of
$food->query('//egg')->remove(); // Removes all the eggs.
Querying and removing with relative XPaths/CSS-Selectors can be done too.
$food->query('/doc')->remove('egg'); // Removes all the eggs.
Pro Tip: ->remove(...$xpath) accepts the same arguments of ->query(...$xpath).
This means that, like ->query(), even ->remove() accepts multiple queries.