title: how to define variable for HTML select
body: <p>I have used PHP array for HTML select, then I put my codes in a template called data.php. I linked the data.php into index.php. so I want to define a variable for my HTML select <code>&lt;select name="color"&gt;</code> in order that I can call this <code>&lt;select name="color"&gt;</code> with its defined variable all across my theme.</p>
  
  <pre><code>$color=array(
       "R" =&gt; 'red',
       "Y" =&gt; 'yellow',
       "B" =&gt; 'blue', 
       "G" =&gt; 'green',
       "P" =&gt; 'purple',
       "O" =&gt; 'orange', 
       "B" =&gt; 'black',
       "G" =&gt; 'gray'
             );
  
  &lt;select name="color"&gt;
     &lt;option value=""&gt;-----------------&lt;/option&gt;
    &lt;?php
    foreach($color as $key =&gt; $value):
    echo '&lt;option value="'.$key.'"&gt;'.$value.'&lt;/option&gt;'; //close your tags!!
    endforeach;
     ?&gt;
  &lt;/select&gt;
  </code></pre>