Do i need to declare an array if i want to assign another array to it?
<p>I have a small question. Do i need to declare an array if i want to assing another array to it?</p>

<p>I want to validate the values from a multiple select control, and i need them to be in an array (for sticky form fields)... i don't remember if in php, i can just assign the select array to a var and the var will become an array automatically or the var needs to be declare first as an array...</p>

<p>I've tried both methods, and it looks to me that both work ok. But, for good practices, i want to make sure... i need to know from the experts!</p>

<p>What do you think?</p>

<pre><code>&lt;select name="genre[]" multiple="multiple" id="genre"&gt;
   &lt;option value="..."&gt;value goes here&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<hr>

<pre><code>// genres
if (isset($_POST['genre'])) {
  $selected_genre = $_POST['genre'];
}
</code></pre>

<p>or</p>

<pre><code>// genres
$selected_genre = array();

if (isset($_POST['genre'])) {
  $selected_genre = $_POST['genre'];
}
</code></pre>
