input: Write a function to filter an array based on a given criteria. The function should iterate through the array, check each element against the criteria, and return a new array containing only the elements that match the criteria. If the criteria function returns True for an element, it should be included in the filtered array, otherwise, it should be excluded.
  
  # Function to filter an array based on a given criteria
  def filter_array(array, criteria):
   # Create an empty list
   filtered_array = []
   # Iterate through the array
   for value in array:
    # Check if it matches the criteria
    if criteria(value):
     # If it matches, add it to the list
     filtered_array.append(value)
  
   # Return the filtered array
   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, 7, 8, 11, 13], lambda x: x % 2 == 0) == [8]
  assert filter_array([], lambda x: x > 0) == []
  assert filter_array([1, 2, 3, 4, 5], lambda x: x % 2 != 0) == [1, 3, 5]
  assert filter_array([10, 20, 30, 40, 50], lambda x: x > 25) == [30, 40, 50]
output: def filter_array(array, criteria):
      filtered_array = []
      for value in array:
          if criteria(value):
              filtered_array.append(value)
      return filtered_array