You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,21 @@ $html = $dom->outerHtml;
90
90
91
91
As long as the Connector object implements the `PHPHtmlParser\CurlInterface` interface properly it will use that object to get the content of the url instead of the default `PHPHtmlParser\Curl` class.
92
92
93
+
Loading Strings
94
+
---------------
95
+
96
+
Loading a string directly, with out the checks in `load()` is also easely done.
97
+
98
+
```php
99
+
use PHPHtmlParser\Dom;
100
+
101
+
$dom = new Dom;
102
+
$dom->loadStr('<html>String</html>', [])
103
+
$html = $dom->outerHtml;
104
+
```
105
+
106
+
If the string is to long, depending on your file system, the `load()` method will throw a warning. If this happens you can just call the above method to bypass the `is_file()` check in the `load()` method.
0 commit comments