for($i = 0; $i < count($copyArr); $i++) {
if(array_key_exists($i + 1, $copyArr)) {
if($copyArr[$i + 1] - $copyArr[$i] === 1) {
$chunk[] = $copyArr[$i];
} elseif(empty($chunk)) {
continue;
} else {
$chunk[] = $copyArr[$i];
$chunkGroup[] = $chunk;
$chunk = [];
array_slice($copyArr, $i + 1);
$i = -1;
}
}
break;
}