I have two array like these.
array("a","b","c");
array("1","2","3");
I have to add those items like that way.
$c=array("a"=>"1","b"=>"2","c"=>"3");
how can i retrieve each inner array by this way.
echo $c[0];
Use array_combine()
Creates an array by using the values from the keys array as keys and the values from the values array as the corresponding values.
<?php
$a = array("a","b","c");
$b = array("1","2","3");
$c = array_combine($a, $b);
print_r($c);
?>
The above example will output:
Array
(
[a] => 1
[b] => 2
[c] => 3
)