Hi There -
I've got two arrays A and B, both numerically indexed, and I want to zipper them together in a key->value relationship in array C so that A[0] becomes the key to B[0]'s value.
Like this:
$A[0] = "apple";
$A[1] = "orange";
$A[2] = "banana";
$B[0] ="cinnamon";
$B[1] ="cloves";
$B[2] ="allspice";
$C = array (
"apple" => "cinnamon"
, "orange" => "cloves"
, "banana" => "allspice"
);
Have tried searching but I don't know what this activity is called. I checked out the merge() function, but that seems to tack the data from array B onto the end of array A. The join() function is the same as implode(), which isn't right either. Can anyone point me in the right direction?
Thanks!