I have two arrays like this:
$arr1 = Array ( [1] => ab [2] => cd [at] => ef )
$arr2 = Array ( [1] => gh [2] => ij [at] => kl )
I want to combine these two arrays to this array:
$arr3 = Array ( [1] => ab-gh [2] => cd-ij [at] => ef-kl )
The keys are the same in the two arrays so I imagine that it is possible to join the values of the arrays with a "-" between like above.
I have googled and tried almost anything (merge, combine, join) but I can't figure it out. Any suggestions?
foreachloop to iterate over the keys of one array. Get the values associated with the key from both arrays, combine them, associate the new value to the same key$arr3.