Fork me on GitHub

Tag: sort

Tag Archives: sort

Use array_merge to reorder arrays

This one is pretty fun. Well, at least I think it is. I was working with jQuery UI Sortables the other day and getting the reordered elements from jQuery back in to PHP for reordering via Ajax I ended up with an array whose elements matched the array keys of the array that I needed […]

August 21, 2009 | PHP Scripting | 1 comment

Sort arrays by key revisited

I don’t know why but I have an infatuation with little utility functions. Its pretty stupid, but it keeps me entertained and provides me with a cheap blog post 😉 That and I’ve noticed it trending A LOT in my search keywords lately, so I figure I should post some updated and easier to use […]

July 29, 2009 | PHP Scripting | Comments Off on Sort arrays by key revisited

PHP: Sort Multidimensional arrays by key

Update 2009-07-29: This code has been updated and posted here: Sort Arrays by Key Revisited. So, I had to do some array sorting this week and finally bit the bullet and wrote a class to handle it. If you’ve got the need to sort a multidimensional array by a sub-array key then this might be […]

November 8, 2006 | PHP Scripting | Comments Off on PHP: Sort Multidimensional arrays by key