count($a); }); $prefix = (string) array_key_first($runs); $numbers = $runs[$prefix]; $start = max(array_map('intval', $numbers)) + 1; foreach ($numbers as $number) { if (strlen($number) > 1 && $number[0] === '0') { $pad = strlen($number); } } } if (!$existing) { $prefix = in_array($asset['asset_type'], ['Switch'], true) ? 'Gi1/0/' : (in_array($asset['asset_type'], ['Firewall/Router', 'Access Point'], true) ? 'Port ' : 'eth'); $start = $prefix === 'eth' ? 0 : 1; } $count = $asset['asset_type'] === 'Switch' ? 24 : 4; ob_start(); ?>