Home Forums Add-ons Repeater Field Problem with an array Reply To: Problem with an array

  • Hmm, I guess there are two solutions to this. The first would be to create a nested repeater, i. e. one repeater for the event dates, and inside that, another repeater for event title and description. And then you loop over the dates, and in each iteration, you loop over the nested repeater to retrieve the other two field values. The documentation describes such a scenario in the section titled “Nested loops”.

    The other option would be to create an associative array, but for that, you can’t use array_push(), you need to use the square bracket notation with the date string as key, like so:
    $events[$event_day] = $single_event;