I've been trying to push an item to an associative array like this:
$new_input['name'] = array(
'type' => 'text',
'label' => 'First name',
'show' => true,
'required' => true
);
array_push($options['inputs'], $new_input);
However, instead of 'name' as the key in adds a number. Is there another way to do it?
There is a better way to do this:
If the array $arr_options contains the existing array.
Warning: $arr_options must exist. if $arr_options already has a ['name'] it wil be overwritten.
Hope this helps.