我有下面的源數組,我試圖重組使用group_name給我下面的require輸出。重組數組在php中
任何幫助或指針讚賞。 謝謝,路
來源:
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
)
)
輸出:
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] =>
)
)
OP需要數組作爲目標數組的值。有了這個,你只會得到一個值。 – J0HN