Skip to content

Commit 2d41963

Browse files
committed
updates to readme adding excludeArray example
1 parent b03f5c7 commit 2d41963

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PHP Library for manipulating network addresses (IPv4 and IPv6).
2727
* Now Testing On PHP v5.6, v7.0, v7.1, v7.2, v7.3, and v7.4
2828
* Added CodeClimate Coverage Reporting
2929
* Added containsAny and containsAll to Range class for dealing with an array of IP/Range/Networks instead of a single one
30-
* Added excludeArray to the Network class for dealing iwth an array of IP/Range/Networks to exclude instead of the single one with the existing exclude method
30+
* Added excludeArray to the Network class for dealing with an array of IP/Range/Networks to exclude instead of the single one with the existing exclude method
3131

3232
## Installation
3333

@@ -133,6 +133,21 @@ foreach($excluded as $network) {
133133
...
134134
192.192.0.0/10
135135

136+
**Exclude Many Subnets from Network:**
137+
```php
138+
$excluded = Network::parse('192.0.0.0/8')->excludeArray(['192.168.1.0/24', '192.168.2.0/24']);
139+
foreach($excluded as $network) {
140+
echo (string)$network . '<br>';
141+
}
142+
```
143+
192.0.0.0/9
144+
192.128.0.0/11
145+
192.160.0.0/13
146+
192.168.0.0/24
147+
192.168.3.0/23
148+
...
149+
192.192.0.0/10
150+
136151
**Split network into equal subnets**
137152
```php
138153
$networks = Network::parse('192.168.0.0/22')->moveTo('24');

0 commit comments

Comments
 (0)