Jump to content

Archived

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

azuka

Sorting a multidimensional array

Recommended Posts

I have an array whose member consist of arrays. I have a problem sorting them. The problem is that for each index, the array structure may vary but it either has these keys [BookId,BookName,BookSummary,Sort] or [ChapId,ChapName,ChapText,BookId, Sort]. Since [b]Sort[/b] is common to both arrays, I want to sort by Sort in descending order. How possible is that?

Share this post


Link to post
Share on other sites
Split them up into arrays of similar types (don't mix books nad chapters0 and then look at using array_mulit sort.

Share this post


Link to post
Share on other sites

×

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.