How do i reference an array as a whole?- php
<p>array_unique is to be used by passing the array name as a parameter.</p>

<p>But as far as all the online examples researched go, it shows the arrays first being assigned to a single variable at the time they are instantiated, like so:</p>

<pre><code>$var1 = $array['val1', 'val2', 'val3']
</code></pre>

<p>The only problem is, i am assigning the values of my array 1 at a time via a loop, so i dont know how to assign my array as a whole to a variable.</p>

<p>So how can i represent the entire array to either put in a variable or pass as a parameter for array_unique directly, without having to reference the specific array values?</p>

<p>Edit: Added the loop where array values are instantiated, as requested.</p>

<pre><code>$productsQueryResult = mysql_query($productsQuery);
        while ($row = mysql_fetch_row($productsQueryResult))
            {
                $array[$i] = $row[0];
                $i++;
            }
</code></pre>
