$max_length = 128; } } $host_min = $ip_manager->get_hostmin(); $host_max = $ip_manager->get_hostmax(); $min_ip_manager = new Netblock($host_min . "/" . $max_length); $max_ip_manager = new Netblock($host_max . "/" . $max_length); $parent_id = $ip_info->get_parent_id(); if (is_numeric($parent_id)) { $all_child_ip = IP_Database::get_all_ip($parent_id, $ip_info->get_family()); } $to_remove = array(); foreach ($all_child_ip as $ip => $addr) { $t_ip_info = new IP_Database($ip); if ($ip_info->get_family() == 4) { if ($t_ip_info->get_address_int() >= $ip_manager->get_long() && $t_ip_info->get_address_int() <= $max_ip_manager->get_long_ip()) { array_push($to_remove, $ip); } } else { if ($ip_info->get_family() == 6) { //split the long ip address into five 10 digits strings $t_addr = str_pad($t_ip_info->get_address_int(), 40, 0, STR_PAD_LEFT); $t_str1 = substr($t_addr, 0, 10); $t_str2 = substr($t_addr, 9, 10); $t_str3 = substr($t_addr, 19, 10); $t_str4 = substr($t_addr, 29, 10); $t_str5 = substr($t_addr, 39, 10); //split the NEW long merged address into five 10 digits strings $i_addr = str_pad($ip_manager->get_long(), 40, 0, STR_PAD_LEFT); $i_str1 = substr($i_addr, 0, 10); $i_str2 = substr($i_addr, 9, 10);