Set dynamic Options array in woocommerce_form_field

So I have the following code:

As you can see I have added $dates[] as an array which could range from 2-X options, which will depend on the product ID.

As an example, I have included the options manually, i.e. dates[0], dates[1] etc…

How would I go about looping this and including it within the options array?

It works fine as it is, but it’s not dynamic.

Any help is much appreciated!