Welcome to WebmasterWorld Guest from 54.234.190.237

Forum Moderators: coopster & jatar k

Sort multi-dimensional array on 2nd dim.

     
11:13 pm on Dec 24, 2017 (gmt 0)

New User

10+ Year Member

joined:Feb 27, 2006
posts: 32
votes: 0


Hi,
I have a multidimensional array like this and would like it sorted on array[]['title].
The array[]['id'] and array[]['title'] stay grouped but the array[] is reorganized.
Does anyone have a way to easily do this with php?
Thanks in advance.


Array (
[0] => Array
(
[id] => 3704
[title] => Zebras
)

[1] => Array
(
[id] => 3705
[title] => Ants
)

[2] => Array
(
[id] => 3706
[title] => Bees
)

And would like it to be

Array (
[0] => Array
(
[id] => 3705
[title] => Ants
)

[1] => Array
(
[id] => 3706
[title] => Bees
)

[2] => Array
(
[id] => 3704
[title] => Zebras
)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members