|
|
@ -141,9 +141,9 @@ Similarly, the `MensBeam\HTML\Parser::serializeInner` method can be used to conv |
|
|
|
```php |
|
|
|
use MensBeam\HTML\Parser; |
|
|
|
|
|
|
|
$document = Parser::parse("<!DOCTYPE html><a>Ook<p>Eek</a>"); |
|
|
|
$document = Parser::parse("<!DOCTYPE html><a>Ook<p>Eek</a>")->document; |
|
|
|
$body = $document->getElementsByTagName("body")[0]; |
|
|
|
echo Parser::serialize($document); // prints "<html><head></head><body><a>Ook</a><p><a>Eek</a></p></body></html> |
|
|
|
echo Parser::serialize($document->documentElement); // prints "<html><head></head><body><a>Ook</a><p><a>Eek</a></p></body></html> |
|
|
|
echo Parser::serializeInner($body); // prints "<a>Ook</a><p><a>Eek</a></p> |
|
|
|
``` |
|
|
|
|
|
|
|