Jump to content

Sorting Multiple Arrays


kornmonkie

Recommended Posts

Hey,

 

I have 3 arrays of info that have been pulled from a database.

 

Here are the names of the arrays.

 

$idcheck[$k]

$titlecheck[$k]

$raritycheck[$k]

 

Each array is related, so $idcheck[1], $titlecheck[1] and $raritycheck[1] all have info related to each other.  Displaying $idcheck[1], $titlecheck[1] and $raritycheck[0] for example, would mismatch the info.

 

What I'm looking to do is setup a way to sort one array, and have the others follow suit.  If $idcheck[1] is sorted alphabeticly, $titlecheck[1] and $raritycheck[1] will still be associated with $titlecheck[1] and be sorted as well.  I'm looking to display the info from all three.

 

I was thinking of using array_multisort, but I am confused by the php site's description of the function.

 

I hope this makes sense.  Let me know if I am being unclear.

 

Cheers.

Link to comment
https://forums.phpfreaks.com/topic/191119-sorting-multiple-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.