$q[] = ["25.02.2022", "27.02.2022", "28.02.2022", "30.02.2022", "25.02.2022", "25.02.2022",
"25.08.2023", "25.08.2023", "25.08.2023", "25.08.2023", "25.02.2023", "25.02.2023",
];
$newArr = array_filter($arr, fn($n) => explode('.', $n)[1] !== '08');
for ($i = 0, $j = 0; $i < count($arr); $i++) {
if (explode('.', $arr[$i])[1] === '08') {
$j++;
} else if ($j) {
$arr[$i - $j] = $arr[$i];
}
}
array_splice($arr, -$j, $j);