klawisze specyficzne dla filtru tablicy PHP

$arr = [
    'foo' => 'bar',
    1 => 'baz',
    'qux' => 22,
    3 => 123,
    'quux' => 'quuz',
];

$filteredArr = array_filter(
    $arr,
    fn ($key) => is_numeric($key),
    ARRAY_FILTER_USE_KEY
);

echo print_r($filteredArr, true); // [1 => 'baz', 3 => 123]
Coder Khayrul