I have this array
$arr = ['field_event_start_date', 'widget', 0, 'value', '#date_part_order', 3]
And I want to convert this into this array in below format
$form['field_event_start_date']['widget'][0]['value']['#date_part_order'][3]
Trying to append the array to $form array.
I have a $form array, which contains many fields, and I want to unset a set of fields. The array above, is part of a bigger array. If I take this array, How do I convert this into array like below
$form['field_event_start_date']['widget'][0]['value']['#date_part_order'][3]
I have tried, implode like this $form[implode('][', $arr)] But this always says, undefined index.
Final code I need to run is
unset($form['field_event_start_date']['widget'][0]['value']['#date_part_order'][3]);
However, there are many like this, which number of depth varying. I need to write a generic function to achieve this.