I have an array
Array
(
[0] => Array
(
[id_session] => 174
[id_participant] => 191
[participant] => A[mail1@xy.com]
)
[1] => Array
(
[id_session] => 175
[id_participant] => 177
[participant] => B[mail2@xy.com]
)
[2] => Array
(
[id_session] => 175
[id_participant] => 189
[participant] => C[mail3@xy.com]
)
)
I wan to get the json or an multiple dim array
Array
(
[174] => Array([191]=>A[mail1@xy.com]),
[175] => Array
(
[177] => B[mail2@xy.com],
[189] => C[mail3@xy.com]
)
)
Anyone could help me how do that?
thanks
Note that I have used the new array syntax. If you are using PHP < 5.4 you should replace
[]byarray().Demo