Skip to content

[Request] Replace child node #52

@hissy

Description

@hissy

Currently we are able to remove specific child and add new child in the tail of the parent, but we can't replace specific tag node.

sunra/php-simple-html-dom-parser can do this.

$child->outertext = '<new />';

Here is my thought:

$child = $parent->find('child')[0];
$newChild = new Tag('new');
$parent->replaceChild($child->id(), $newChild);

Thanks!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions