I have two arrays same like when var_dump:
$arr1 = array (size=2)
0 => string '10:2'
1 => string '10:1'
$arr2 = array (size=2)
0 => string '[{username:userA,email:[email protected]'
1 => string 'username:userB,email:[email protected]}]'
Now, i want to result same below:
$result = array (size=2)
'10:2' =>
array (size=2)
'username' => string 'userA'
'email' => string '[email protected]'
'10:1' =>
array (size=2)
'username' => string 'userB'
'email' => string '[email protected]'
Thanks for help!
array_combine()to join the 2 arrays.$arr2formatted differently? One has[{at the beginning the other has}]at the end. Why don't those characters appear in$result?$arr2(usename and password) ! you aren't clear !