damncoffie
0
Q:

merge two arrays one as key to another php

$output = array_merge($array1, $array2);
3
// two arrays one become keys and second becomes values
array_combine ( array $keys , array $values );
0
Input : $a1=array("a"=>"raj", "b"=>"striver");
        $a2=array("z"=>"geeks", "b"=>"articles");
Output : 
Array
(
    [a] => raj
    [b] => Array
        (
            [0] => striver
            [1] => articles
        )

    [z] => geeks
)
0
$all_arrays = array_merge($array1, $array2, $array3, ...);
0

New to Communities?

Join the community