maliary Posted June 6, 2008 Share Posted June 6, 2008 Hi guys, Please bear with the prose, I just don't have a clue for the code required here. I have an array of items that was saved in a certain order say an array of items a,b,c,d was saved as b,c,a,d based on how the user had ordered them. The user orders the items for display in this same way as they are saved so they are displayed as b,c,a,d and also saved in the same order such that even upon database retrieval they should follow the same ordering. However the user changes the ordering so the new order now is c,b,d,a. Now this new ordering does not affect the already saved items that were saved in the previous order (I hope this is obvious). So does anyone have an idea of what kind of function to use so as to display the saved items in this new order ? Quote Link to comment https://forums.phpfreaks.com/topic/108963-complex-array-sorting/ Share on other sites More sharing options...
Daniel0 Posted June 6, 2008 Share Posted June 6, 2008 Why does it matter which order they're in? Anyways, you can just sort them alphabetically. Quote Link to comment https://forums.phpfreaks.com/topic/108963-complex-array-sorting/#findComment-559009 Share on other sites More sharing options...
maliary Posted June 6, 2008 Author Share Posted June 6, 2008 Well, Yes it does matter, alphabetical ordering doesn't count here but ordering as the user wants them to appear. Reply if you can't understand it and I'll re-post. Quote Link to comment https://forums.phpfreaks.com/topic/108963-complex-array-sorting/#findComment-559056 Share on other sites More sharing options...
Daniel0 Posted June 6, 2008 Share Posted June 6, 2008 I don't understand why it matters that the second order is c,b,d,a while the first order is b,c,a,d... Quote Link to comment https://forums.phpfreaks.com/topic/108963-complex-array-sorting/#findComment-559068 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.