I have a custom drupal 7 form as below
$form['general_details'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#description' => t('General Information.'),
'#required' => TRUE,
);
$form['general_details']['salutation'] = array(
'#type' => 'select',....
I am getting an error in the line "$form['general_details']['salutation']" Error: Cannot use string offset as an array with PHP7.2
Can someone help ? Thanks in advance.
You must declare empty array before assign it
$form = array();
$form['general_details'] = array(
'#type' => 'fieldset',
'#title' => t('General'),
'#description' => t('General Information.'),
'#required' => TRUE,
);
$form['general_details']['salutation'] = array(
'#type' => 'select',....