(PHP 8 >= 8.4.0)
Dom\HTMLDocument::createFromFile — Parses an HTML document from a file
public static Dom\HTMLDocument::createFromFile(string $path, int $options = 0, ?string $overrideEncoding = null): Dom\HTMLDocument
Parses an HTML document from a file, according to the living standard.
pathoptions Bitwise OR of the libxml option constants.
Dom\HTML_NO_DEFAULT_NS to disable the use of the HTML namespace and the template element. This should only be used if the implications are properly understood. overrideEncodingThe parsed document as an Dom\HTMLDocument instance.
path contains null bytes or contains "%00". options contains an invalid option. overrideEncoding is an unknown encoding. Note: Whitespace in the
htmlandheadtags is not considered significant and may lose formatting.
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/dom-htmldocument.createfromfile.php