- var_dump: documentation ( source)
- array_filter: documentation ( source)
<?php
$arr = array(
'key' => 'foo',
'key2' => 'bar',
0 => 'num_foo',
1 => 'num_bar'
);
$new_array = array_filter ($arr, function($key) { return is_int($key); }, ARRAY_FILTER_USE_KEY);
var_dump($new_array);