I am using CodeIgniter. I want to create an array to add to a dropdown which contains the numbers 1 -> 1000.
I have tried the php range() function like so
$arr = range(1,1000);
It worked and create a dropdown from 1 to 1000.
I do have one problem though.
When select text 1 from my drop down and post, the posting value is 0.
Because by default the keys are starting from 0 and the key is set to the dropdown value
Here is part of my drop down HTML
<select id="user-day" class="dropdown-small Verdana11-424039" tabindex="123456" name="days_of_month">
<option value="0">1</option>
<option value="1">2</option>
<option value="2">3</option>
<option value="3">4</option>
<option value="4">5</option>
<option value="5">6</option>
<option value="6">7</option>
Is there any way I can define range() with key values?
Such that the values will become
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>