$arr1 = array('001','002','003');
$arr2 = array('aaa','bbb','ccc');
//$result = join $arr1 and $arr2;
I want $result such that $arr1 value becomes index of $result and $arr2 become value of each index of $result. Final result should be
$result = array("001"=>"aaa","002"=>"bbb","003"=>"ccc");
Use array_combine. Example:
array_combine($keys,$values)
for your question
try
$result = array_combine($arr1,$arr2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With