I’m trying to populate a drop down list box based on array contents. The first option must be associated with the 1 value. What’s the problem with the following code?
<?php
echo '<select id="t">';
$arr = array(
'a',
'b',
'c',
'd',
);
for ($i = 1; $i <= 4; $i++) {
echo '<option value="' .$i. '">' .$arr[$i--]. '</option>';
}
echo '</select>';
?>