tholu / php-cidr-match
CIDRmatch is a library to match an IP to an IP range in CIDR notation (IPv4 and IPv6).
Installs: 139 839
Dependents: 1
Suggesters: 0
Security: 0
Stars: 33
Watchers: 4
Forks: 10
Open Issues: 0
Requires
- php: >=5.4
Requires (Dev)
- composer/composer: >2
- phpunit/phpunit: 4.8.36
- squizlabs/php_codesniffer: 3.6.2
This package is not auto-updated.
Last update: 2024-11-07 03:40:45 UTC
README
CIDR match
CIDRmatch is a library to match an IP to an IP range in CIDR notation (IPv4 and IPv6).
NOTE: Symfony2 already does everything this library here does with its IpUtils module. Unfortunately I discovered this only after I finished working on this library.
Usage
$cidrMatch = new CIDRmatch();
$cidrMatch->match($ip, $cidr);
Tests
./vendor/bin/phpunit tests/CIDRmatchTest