input: Write a function to filter an array by a given criteria. Implement the function in a way that it takes an array and a criteria function as input, and returns a list of elements from the array that satisfy the criteria. If the array is empty, return an empty list.
  
  def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array
  
  assert filter_array([1, 2, 5, 10, 15, 20, 25, 30], lambda x: x % 5 == 0) == [5, 10, 15, 20, 25, 30]
  assert filter_array([3, 6, 9, 12, 15], lambda x: x % 3 == 0) == [3, 6, 9, 12, 15]
  assert filter_array([], lambda x: x % 2 == 0) == []
  assert filter_array([7, 14, 21, 28], lambda x: x % 7 == 0) == [7, 14, 21, 28]
  assert filter_array([1, 2, 3, 4, 5], lambda x: x > 3) == [4, 5]
output: def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array