Jump to content

how to group my arrays


sw9

Recommended Posts

i have an array that looks like this:

Array ( 
[0] => Array ( [Webcast] => 1250251200 ) 
[1] => Array ( [Ch16 North] => 1250251200 ) 
[2] => Array ( [Ch16 South] => 1250251200 ) 
[3] => Array ( [Webcast] => 1250290800 )
[4] => Array ( [Ch16 South] => 1250290800 ) 
		) 

 

I want to resort the array so that it groups by timestamp, so it would be something like this:

Array (
[0] => Array ( [1250251200] => 'Webcast', 'Ch16 North', Ch16 South' ) 
[1] => Array ( [1250290800] => 'Webcast', 'Ch16 South' )
)

 

i am getting confused on if there is actually an existing sort function i can use to do this or if i have to loop through to mix them. can anyone help me find the most efficient way on this? thanks so much in advance.

Link to comment
https://forums.phpfreaks.com/topic/170121-how-to-group-my-arrays/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.