Question: I have two arrays like below example..

```
 $arr1 = array("0" => "1");
 $arr2 = array("2" => "3");

```

i want to make two different array by merging all the keys in one array and and all the values inside another array.

Expected output..

```
$arr3 = array("0" => "2");
$arr4 = array("1" => "3");

```

Answer: 
The following work for the example given. Use [`array_combine`](http://php.net/manual/en/function.array-combine.php) with [`array_keys`](http://php.net/manual/en/function.array-keys.php) for `$arr3` and [`reset`](http://php.net/manual/en/function.reset.php) for `$arr4` -

```
//extract the keys and combine them
$arr3 = array_combine(array_keys($arr1), array_keys($arr2));

//extract the first value and combine them
$arr4 = array_combine(array(reset($arr1)), array(reset($arr2)));

```
Perhaps you can use [array\_combine()](http://php.net/manual/en/function.array-combine.php)

```
<?php
$a = array('green', 'red', 'yellow');
$b = array('avocado', 'apple', 'banana');
$c = array_combine($a, $b);

print_r($c);
?>

```