--- title: Document::loadHTML --- Document::loadHTML — Load HTML from a string ## Description ## ```php public Document::loadHTML ( string $source , null $options = null , string|null $encodingOrContentType = null ) : bool ``` The function parses the HTML contained in the string source. ## Parameters ##
source
options
null
. Was used for option constants in \DOMDocument
.encodingOrContentType
true
on success or false
on failure.
## Examples ##
**Example \#1 Creating a Document**
```php
loadHTML('