input: Write a function to filter an array by a given criteria. The criteria is a function that returns True for elements that meet the condition and False otherwise. Return the filtered array consisting of elements that satisfy the criteria.
  
  def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array
  
  def criteria(x):
      return x % 5 == 0
  
  array = [1, 2, 5, 10, 15, 20, 25, 30]
  assert filter_array(array, criteria)==[5, 10, 15, 20, 25, 30]
  array = [3, 6, 12, 17, 22, 28]
  assert filter_array(array, criteria)==[]
  array = []
  assert filter_array(array, criteria)==[]
  array = [0, 5, 10, 15, 20]
  assert filter_array(array, criteria)==[0, 5, 10, 15, 20]
output: def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array