Given the following array:
Array
(
[entity] => Array
(
[title] => Array
(
[empty] => error message
)
[link] => Array
(
[empty] => error message
)
[authors] => Array
(
[0] => Array
(
[full_name] => Array
(
[max_lengh] => another error message 2
)
)
)
)
)
How to convert it into a form like:
$array = [
'entity[title]' => 'error message',
'entity[link]' => 'error message',
'entity[authors][0][full_name]' => 'another error message 2',
];
I think this is done via recursion or use the references but the two things I'm not good) Thanking you in advance!