I have the following source array which I'm trying to restructure using group_name to give me the require output below.
Any help or pointers appreciated. Thanks, Lk
Source:
Array
(
[field_a] => Array
(
[type] => text
[group_name] =>
)
[field_b] => Array
(
[type] => number_integer
[group_name] => group_other
)
[field_c] => Array
(
[type] => text
[group_name] =>
)
[field_d] => Array
(
[type] => link
[group_name] => group_web_links
)
[field_e] => Array
(
[type] => link
[group_name] => group_web_links
)
[field_f] => Array
(
[type] => text
[group_name] => group_web_links
)
)
Output:
Array
(
[group_other] => Array
(
[field_b] => Array
(
[type] => number_integer
[group_name] => group_other
)
)
[group_web_links] => Array
(
[field_d] => Array
(
[type] => link
[group_name] => group_web_links
)
[field_e] => Array
(
[type] => link
[group_name] => group_web_links
)
[field_f] => Array
(
[type] => text
[group_name] => group_web_links
)
)
[field_a] => Array
(
[type] => text
[group_name] =>
)
[field_c] => Array
(
[type] => text
[group_name] =>
)
)