aebstract Posted September 22, 2010 Share Posted September 22, 2010 I have an array, and to make it easy let's say they have 2 values: ET and SPEED Here is an example chart of the array printed out: KEY ET SPEED 8 5.2 60 3 5.3 60 1 5.4 70 7 5.4 60 9 5.4 90 6 5.5 60 5 5.6 60 2 5.6 65 4 5.7 60 I need to take this array and each group that has a matching ET, put them in order based on SPEED. The corrected chart should be like this: KEY ET SPEED 8 5.2 60 3 5.3 60 9 5.4 90 1 5.4 70 7 5.4 60 6 5.5 60 2 5.6 65 5 5.6 60 4 5.7 60 Just not sure of how to only arrange the section that need to be. Keys stay the same, just the order changes. Link to comment https://forums.phpfreaks.com/topic/214112-arrange-sections-of-an-array/ Share on other sites More sharing options...
petroz Posted September 22, 2010 Share Posted September 22, 2010 Take a look at this.. http://php.net/manual/en/function.sort.php Link to comment https://forums.phpfreaks.com/topic/214112-arrange-sections-of-an-array/#findComment-1114132 Share on other sites More sharing options...
aebstract Posted September 22, 2010 Author Share Posted September 22, 2010 That's nice and all, but I don't know how to target only the sections that have similar ETs to switch, rather than sort the entire array. Link to comment https://forums.phpfreaks.com/topic/214112-arrange-sections-of-an-array/#findComment-1114133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.