NativeParser
in package
implements
ParserInterface
FinalYes
Parser using PHP 8.4's new Dom API.
Table of Contents
Interfaces
- ParserInterface
- Transforms an untrusted HTML input string into a DOM tree.
Methods
- __construct() : mixed
- parse() : Node|null
- Parse a given string and returns a DOMNode tree.
Methods
__construct()
public
__construct() : mixed
parse()
Parse a given string and returns a DOMNode tree.
public
parse(string $html[, string $context = 'body' ]) : Node|null
This method must return null if the string cannot be parsed as HTML.
Parameters
- $html : string
- $context : string = 'body'