codice:
function filter($array) {
  if($array['Item']['type_id'] == '2') {
     return true;
  } else {
     return false;
  }
}

print_r(array_keys(array_filter($array1, 'filter')));