How can I group arrays into one array in php?
<p>I would like to convert / form the following arrays as example:</p>

<pre><code>Array ( [product_category] =&gt; for-women ) Array ( [brand] =&gt; 7-diamonds ) Array ( [size] =&gt; 12 ) Array ( [color] =&gt; 882536 )
</code></pre>

<p>Into one array that just merges each array pair and put them altogether :</p>

<pre><code>Array ( [product_category] =&gt; for-women [brand] =&gt; 7-diamonds [size] =&gt; 12 [color] =&gt; 882536 )
</code></pre>

<p>I tried array_merge and it didn't work. The array out put in my code is from $_SESSION which returns an array (a pair key=> value) like this:</p>

<pre><code>foreach($_SESSION as $k =&gt; $v) {
    if (strstr($k, 'saved_query_') == true) {
        $saved = array_merge($v);
    }
}
</code></pre>

<p>So I get each array by looping through session which has a query, the result is array pair, I want to combine all pairs found (Do not know how to use array_merge in that case).</p>

<p>I tried array_combine and array_merge they do not seem like the functions I need based on php manual: </p>

<p><strong>array_combine — Creates an array by using one array for keys and another for its values</strong></p>

<p>Which I do not want to do, I just want to copy/move small arrays in one array, without changing any pairing/key/value.</p>
