hey all,
I have an array that i am using to populate a dropdown field of a form, what i want to do is assign the value tag a number of which position the state name is in the array …
[php]$state = array(
1 => array(‘Alabama’,‘Alaska’,‘Arizona’,‘Arkansas’,‘California’,‘Colorado’,‘Connecticut’,‘Delaware’,‘District of Columbia’,‘Florida’,‘Georgia’,‘Hawaii’,‘Idaho’,‘Illinois’,‘Indiana’,‘Iowa’,‘Kansas’,‘Kentucky’,‘Louisiana’,‘Maine’,‘Montana’,‘Nebraska’,‘Nevada’,‘New Hampshire’,‘New Jersey’,‘New Mexico’,‘New York’,‘North Carolina’,‘North Dakota’,‘Ohio’,‘Oklahoma’,‘Oregon’,‘Maryland’,‘Massachusetts’,‘Michigan’,‘Minnesota’,‘Mississippi’,‘Missouri’,‘Pennsylvania’,‘Rhode Island’,‘South Carolina’,‘South Dakota’,‘Tennessee’,‘Texas’,‘Utah’,‘Vermont’,‘Virginia’,‘Washington’,‘West Virginia’,‘Wisconsin’,‘Wyoming’),
[/php]
How can i assign the value as a number of its position in the array for example Alabama would have a value of 1 and florida would be 10 as alabama is first in the array and florida is 10th