I have some checkboxes on an HTML form named: name="subject[]"
When the checkbox array is passed it arrives in alphabetical order. I want to recieve the array in the order in which the text boxes were selected so I can display the corresponding information on the page in the correct order. Is this possible?
Thanks
Ryan
but the array has numeric keys -> so its not neccessary to sort the array
$i=0; while{$i<sizeof($array)){ echo $array[$i]."<br>"; $i++; }
yes, but the key array[0],array[1],array[2],array[3] etc.............
appear automatically in alphabetical order a,b,c,d respectively. It seems to be the default way the array is passed from the HTML form.
Thanks for your comments anyway
if you dont have numeric keys, read about array_flip arsort and again array_flip :-)