PHP code example of webnium / network-address-group
1. Go to this page and download the library: Download webnium/network-address-group library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webnium / network-address-group example snippets
use Webnium\IpAddress\NetworkAddressGroup;
$group = new NetworkAddressGroup([
'192.168.0.0/24',
'192.168.2.0/24',
'10.1.0.0/16',
'10.0.1.64/27']);
var_dump($group->encloses('192.168.0.53')); // bool(true)
var_dump($group->encloses('192.168.1.1')); // bool(false)