How to convert one dimensional array to two dimensional array
I have the following array coming from a form with multilingual data like this:
Array
(
[en_name] => ...........
[en_description] => ...........
[gr_name] => ...........
[gr_description] => ...........
)
How can this array be converted to two-dimensional, for example:
Array
(
[en] => Array
(
[name] => ...........
[description] => ...........
)
[gr] => Array
(
[name] => ...........
[description] => ...........
)
)
+3
source to share
3 answers