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)
Alphabetizing Postcodes
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Alphabetizing Postcodes
Try natsort().
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Alphabetizing Postcodes
That solved my problem completely. Thank you so much.