File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,47 @@ class Pdp\Uri\Url#6 (8) {
197
197
}
198
198
```
199
199
200
+ ### IPv6 Support
201
+
202
+ Parsing IPv6 hosts is no different that parsing standard hosts. Setting ` $host = 'http://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:8080/'; `
203
+ in the * Parsing URLs* example would return:
204
+
205
+ ```
206
+ class Pdp\Uri\Url#6 (8) {
207
+ private $scheme =>
208
+ string(4) "http"
209
+ private $host =>
210
+ class Pdp\Uri\Url\Host#5 (4) {
211
+ private $subdomain =>
212
+ NULL
213
+ private $registerableDomain =>
214
+ NULL
215
+ private $publicSuffix =>
216
+ NULL
217
+ private $host =>
218
+ string(38) "[2001:db8:85a3:8d3:1319:8a2e:370:7348]"
219
+ }
220
+ private $port =>
221
+ string(4) "8080"
222
+ private $user =>
223
+ NULL
224
+ private $pass =>
225
+ NULL
226
+ private $path =>
227
+ string(1) "/"
228
+ private $query =>
229
+ NULL
230
+ private $fragment =>
231
+ NULL
232
+ }
233
+ ```
234
+
235
+ ** IMPORTANT** : IPv6 url host names * must* be enclosed in square brackets. They
236
+ will not be parsed properly otherwise.
237
+
238
+ > Hat tip to [ @geekwright ] ( https://github.com/geekwright ) for adding IPv6 support in a
239
+ > [ bugfix pull request] ( https://github.com/jeremykendall/php-domain-parser/pull/35 ) .
240
+
200
241
### Parsing Domains ###
201
242
202
243
If you'd like to parse the domain (or host) portion only, you can use
You can’t perform that action at this time.
0 commit comments