When I use the sort function in php it deletes all of the keys. What's an alternative method?
Thank you, seems like a bit of an after thought from the PHP developers.
Ben Shelock
2010-02-11 17:22:26
+4
A:
You want to use asort
instead of sort
which keeps your key associations intact:
hurikhan77
2010-02-10 21:20:54
+3
A:
asort — Sort an array and maintain index association. I guess that is what you're searching for.
AndiDog
2010-02-10 21:20:54