php - make one array the key and another array the value -
this question has answer here:
- how combine 2 arrays together? 3 answers
say have 2 arrays, first array is:
array ( [3] => 1 [4] => 2 )
the seccond array:
array ( [0] => first [1] => second )
i looking way grab values each array, , make array so:
array ( [one] => first [two] => second )
so value first array becomes key , value second array value in new array. if makes sense @ all.
you need array_combine
function of php
array_combine($array1,$array2);
here $array1
keys , $array2
values
Comments
Post a Comment