Jump to content

Sorting on the content of a specific item in a multi-dimensional array


kenoli

Recommended Posts

I have a multi-dimensional array that looks like this: Array( [1] => Array ( [vid] => 1 [media] => Giclee => 12"x12" [price] => 100.00 ) [2] => Array ( [vid] => 2 [media] => Silk on Wood => 12"x12" [price] => 75.00 ) [3] => Array ( [vid] => 3 [media] => Giclee => 24"x24" [price] => 4000.00 ) ) I want to sort it so that the top level array items (the ones with numeric keys) are ordered alphabetically on the content of the nested item with the key "media." I have looked at the function array_multisort but can't figure out how to set it up to do what I want. Can anyone help me? Thanks, --Kenoli

Link to comment
Share on other sites

Thanks. I will take a look at this. I also need to re-think the database sort angle. There was some reason I didn't think this would work, but I'm going to have to take a moment to look at it. I've also been refactoring this code and need to see where things are now. I appreciate your taking the time to respond. Your response is useful. --Kenoli

Link to comment
Share on other sites

  • 3 weeks later...

Archived

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

×
×
  • Create New...