input: 
  def filter_array(array, criteria):
      """
      Function to filter an array by a given criteria.
      >>> filter_array([1, 2, 5, 10, 15, 20, 25, 30], lambda x: x % 5 == 0)
      [5, 10, 15, 20, 25, 30]
      """
      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