Alphabetizing Postcodes
Posted: Sat Aug 21, 2010 2:00 pm
Hi,
I need some help alphabetizing an array. The array is full of postcodes from England. When I try to sort() them though I end up with this:
[text]CM0 Southminster
CM1 Chelmsford
CM11 Billericay
CM12 Billericay
CM19 Harlow
CM2 Chelmsford
CM20 Harlow
[/text]
As you can probably guess, this isn't how I want them. I need them sorted numerically as well as alphabetically, so that they'll look like this:
[text]CM0 Southminster
CM1 Chelmsford
CM2 Chelmsford
CM11 Billericay
CM12 Billericay
CM19 Harlow
CM20 Harlow
[/text]
Any help would be greatly appreciated.
Thanks,
lacorp
(Please note that the actual dataset is much larger than what I used as an example)
I need some help alphabetizing an array. The array is full of postcodes from England. When I try to sort() them though I end up with this:
[text]CM0 Southminster
CM1 Chelmsford
CM11 Billericay
CM12 Billericay
CM19 Harlow
CM2 Chelmsford
CM20 Harlow
[/text]
As you can probably guess, this isn't how I want them. I need them sorted numerically as well as alphabetically, so that they'll look like this:
[text]CM0 Southminster
CM1 Chelmsford
CM2 Chelmsford
CM11 Billericay
CM12 Billericay
CM19 Harlow
CM20 Harlow
[/text]
Any help would be greatly appreciated.
Thanks,
lacorp
(Please note that the actual dataset is much larger than what I used as an example)