PHP code example of silverstripeltd / submuncher
1. Go to this page and download the library: Download silverstripeltd/submuncher 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/ */
silverstripeltd / submuncher example snippets
$longList = ['1.1.1.0', '1.1.1.1', '1.1.1.2'];
$subMuncher = new SubMuncher();
$shortList = $subMuncher->consolidate($longList, 1);
// $shortList is ['1.1.1.0/30']
echo $subMuncher->getLeakTotal();
// Outputs "1" - 1.1.1.3 was leaked.