input: def filter_array(array, criteria):
      """
      Filter an array based on a given criteria and return the filtered array.
      >>> filter_array([1, 2, 5, 10, 15, 20, 25, 30], lambda x: x % 5 == 0)
      [5, 10, 15, 20, 25, 30]
      >>> filter_array([1, 2, 3, 4, 5], lambda x: x % 2 == 0)
      [2, 4]
      """
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array
output:     filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array