0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.226.186.153


Current Path : /var/www/website/nublr/Regulations/simplehtmldom/manual/docs/manual/
Upload File :
Current File : /var/www/website/nublr/Regulations/simplehtmldom/manual/docs/manual/creating-dom-objects.md

---
title: Creating HTML DOM objects
---

## From string

```php
<?php
include_once 'HtmlDocument';
use simplehtmldom\HtmlDocument;

$html = new HtmlDocument();
$html->load('<html><body>Hello!</body></html>');
```

## From URL

```php
<?php
include_once 'HtmlWeb';
use simplehtmldom\HtmlWeb;

$html = new HtmlWeb();
$html->load('http://www.google.com/');

```

## From file

```php
<?php
include_once 'HtmlDocument';
use simplehtmldom\HtmlDocument;

$html = new HtmlDocument();
$html->loadFile('test.htm');
```