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
+8-8
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ This package can be found on [packagist](https://packagist.org/packages/paquettg
23
23
Basic Usage
24
24
-----
25
25
26
-
You can find many examples of how to use the dom parser and any of its parts (which you will most likely never touch) in the tests directory. The tests are done using PHPUnit and are very small, a few lines each, and are a great place to start. Given that, I'll still be showing a few examples of how the package should be used. The following example is a very simplistic usage of the package.
26
+
You can find many examples of how to use the DOM parser and any of its parts (which you will most likely never touch) in the tests directory. The tests are done using PHPUnit and are very small, a few lines each, and are a great place to start. Given that, I'll still be showing a few examples of how the package should be used. The following example is a very simplistic usage of the package.
27
27
28
28
```php
29
29
// Assuming you installed from Composer:
@@ -36,7 +36,7 @@ $a = $dom->find('a')[0];
36
36
echo $a->text; // "click here"
37
37
```
38
38
39
-
The above will output "click here". Simple no? There are many ways to get the same result from the dome, such as `$dom->getElementsbyTag('a')[0]` or `$dom->find('a', 0)` which can all be found in the tests or in the code itself.
39
+
The above will output "click here". Simple, no? There are many ways to get the same result from the DOM, such as `$dom->getElementsbyTag('a')[0]` or `$dom->find('a', 0)`, which can all be found in the tests or in the code itself.
40
40
41
41
Support PHP Html Parser Financially
42
42
--------------
@@ -48,7 +48,7 @@ Tidelift delivers commercial support and maintenance for the open source depende
48
48
Loading Files
49
49
------------------
50
50
51
-
You may also seamlessly load a file into the dom instead of a string, which is much more convenient and is how I except most developers will be loading the html. The following example is taken from our test and uses the "big.html" file found there.
51
+
You may also seamlessly load a file into the DOM instead of a string, which is much more convenient and is how I expect most developers will be loading the HTML. The following example is taken from our test and uses the "big.html" file found there.
52
52
53
53
```php
54
54
// Assuming you installed from Composer:
@@ -74,12 +74,12 @@ foreach ($contents as $content)
74
74
}
75
75
```
76
76
77
-
This example loads the html from big.html, a real page found online, and gets all the content-border classes to process. It also shows a few things you can do with a node but it is not an exhaustive list of methods that a node has available.
77
+
This example loads the html from big.html, a real page found online, and gets all the content-border classes to process. It also shows a few things you can do with a node but it is not an exhaustive list of the methods that a node has available.
78
78
79
-
Loading Url
79
+
Loading URLs
80
80
----------------
81
81
82
-
Loading a url is very similar to the way you would load the html from a file.
82
+
Loading a URL is very similar to the way you would load the HTML from a file.
$html = $dom->outerHtml; // same result as the first example
96
96
```
97
97
98
-
loadFromUrl will, by default, use an implementation of the `\Psr\Http\Client\ClientInterface` to do the HTTP request and a default implementation of `\Psr\Http\Message\RequestInterface` to create the body of the request. You can easely implement your own version of either the client or request to use a custom HTTP connection when using loadFromUrl.
98
+
loadFromUrl will, by default, use an implementation of the `\Psr\Http\Client\ClientInterface` to do the HTTP request and a default implementation of `\Psr\Http\Message\RequestInterface` to create the body of the request. You can easily implement your own version of either the client or request to use a custom HTTP connection when using loadFromUrl.
99
99
100
100
```php
101
101
// Assuming you installed from Composer:
@@ -108,7 +108,7 @@ $dom->loadFromUrl('http://google.com', null, new MyClient());
108
108
$html = $dom->outerHtml;
109
109
```
110
110
111
-
As long as the client object implements the interface properly it will use that object to get the content of the url.
111
+
As long as the client object implements the interface properly, it will use that object to get the content of the url.
0 commit comments