How to change the key name of an array to the key value of the second array when the array length is the same. For example, I have $ aa .... $ bb $ aaArray & nbsp; (0 & nbsp; & gt; cd, 1 & nbsp; & gt; udd, 2 & gt; dsd); $ bbArray & nbsp; (& nbsp; 0 & nbsp; & gt; & nbsp; 13ds, 1 & nbsp; & gt; the length of the tdfe array is the same, how to change the key name of an array to the key value of the second array.
For example, I have $ aa... $ bb
$ Aa = Array ("0" => "cd", "1" => "udd", "2" => "dsd ");
$ Bb = Array ("0" => 13ds, "1" => "tdfestsdfa1", "2" => "1122sdfdsasdf33abc ");
Convert the key name of the $ aa array to the key value of the second array $ bb.
How to form the following array ¥ cc.
$ Cc = Array ("cd" => 13ds, "udd" => "tdfestsdfa1", "dsd" => "1122sdfdsasdf33abc ");
Please kindly advise.
------ Solution ----------------------
$aa = Array("0" => "cd", "1" => "udd","2" => "dsd");
$bb = Array("0" => "13ds", "1" => "tdfestsdfa1", "2" => "1122sdfdsasdf33abc");
$cc = array_combine($aa, $bb);
print_r($cc);
$aa = Array("0" => "cd", "1" => "udd","2" => "dsd");
$bb = Array("0" => "13ds", "1" => "tdfestsdfa1", "2" => "1122sdfdsasdf33abc");
$cc = array_combine($aa, $bb);
print_r($cc);