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 <select name="color"> in order that I can call this <select name="color"> with its defined variable all across my theme.
$color=array(
"R" => 'red',
"Y" => 'yellow',
"B" => 'blue',
"G" => 'green',
"P" => 'purple',
"O" => 'orange',
"B" => 'black',
"G" => 'gray'
);
<select name="color">
<option value="">-----------------</option>
<?php
foreach($color as $key => $value):
echo '<option value="'.$key.'">'.$value.'</option>'; //close your tags!!
endforeach;
?>
</select>