I am trying to combine two arrays in one array, i want to get value and need to keep it has a key for second array.
example
Array (
[CONFIRMATION_NUM] => DBSUUA
)
**
here my code
first array
**
Array (
[0] => CONFIRMATION_NUM
[1] => BOOKING_AGENT
[2] => CONFIRMATION_NUM
[3] => BOOKING_AGENT
[4] => CONFIRMATION_NUM
[5] => BOOKING_AGENT
[6] => CONFIRMATION_NUM
[7] => BOOKING_AGENT
[8] => CONFIRMATION_NUM
[9] => BOOKING_AGENT
[10] => CONFIRMATION_NUM
[11] => BOOKING_AGENT
[12] => CONFIRMATION_NUM
)
second array is
Array (
[0] => DBSUUA
[1] => faras-nmdc
[2] => UKAZZQ
[3] => yco-lmcy
[4] => QVTUTS
[5] => sohail-npcc
[6] => HGQQEF
[7] => masood-muss
[8] => HOHCFQ
[9] => yco-lmcy
[10] => JSDUIT
[11] => otacallcentre
[12] => LHLHWL
)
I tried with this code in this code $tablecolumnsarray is first array and $tabledatacsvcolumnarray is the second array name
$keys = array_keys($tablecolumnsarray);
$final=array();
foreach ($tabledatacsvcolumnarray as $v) {
$final[]=array_combine($keys,$v);
}
print_r($final);