Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Scott committed Nov 18, 2024
1 parent 14d57e7 commit 79912a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,10 @@ Replace each node in the current set with the contents provided.

``` php
$doc = (new Document())->html('<p><b>Hello</b> <b>World!</b></p>');
echo $doc->find('b')->substituteWith(function($node) {
$doc->find('b')->substituteWith(function($node) {
return '<em>' . $node->text() . '</em>';
});
echo $doc->html();
```

*Result:*
Expand All @@ -535,7 +536,7 @@ echo $doc->find('.text')->text();

*Result:*
``` html
<div class="second"></div>
Hello World!
```

Set the text contents for current set.
Expand Down

0 comments on commit 79912a1

Please sign in to comment.