merge php arrays like array_combine, but not glue, but get a nested array?
array 1
Array ( [0] => xxx1 [1] => xxx2 [2] => xxx3 [3] => xxx4 [4] => xxx5 [5] => xxx6 ) array 2
Array ( [0] => yyy1 [1] => yyy2 [2] => yyy3 [3] => yyy4 [4] => yyy4 [5] => yyy4 ) get out
Array ( [yyy1] => xxx1 [yyy2] => xxx2 [yyy3] => xxx3 [yyy4] => Array (xxx4, xxx5, xxx6) ) UPDATE in general the problem is as follows: 2 arrays, both equal in the number of pairs of key => value (this condition is constant)
further: in array 1 there is a certain value that we catch, say it is "X", it can repeat n times.
you need to get the keys "X" and for these keys create an array of the values of mossive2
array1
( [0] => tresh1 [1] => tresh2 [2] => X [3] => X [4] => tresh3 ) array2
( [0] => tresh11 [1] => tresh22 [2] => need1 [3] => need2 [4] => tresh33 ) at the exit
( [X] => Array(need1, need2) )
yyy1/yyy2/yyy3/yyy5/yyy6/yyy4or in an array with valuesxxx1/xxx1/xxx2/xxx3/xxx4/xxx4.... . etc. - Alexey Shimansky