Say I have list of males sorted by their scores and list of females sorted by their scores as well(from highest to lowest). Now I want to have a list of:
Highest score male, Highest score female, 2nd score male, 2nd score female, 3rd score male, 3rd score female, etc...
(Note that, event if highest score female lower than 2nd score male, it is not important.)
How could I do that with php ?
Update as requested:
Array called: $arr_sort[$score][$gender]
Input array 1:
$arr_sort[20][male],$arr_sort[18][male],$arr_sort[17][male],$arr_sort[10][male],$arr_sort[9][male],$arr_sort[5][male],$arr_sort[1][male]
Input array 2:
$arr_sort[15][female],$arr_sort[14][female],$arr_sort[13][female]
expected result:
$arr_sort[20][male],$arr_sort[15][female],$arr_sort[18][male],$arr_sort[14][female],$arr_sort[17][male],$arr_sort[13][female],$arr_sort[10][male],$arr_sort[9][male],$arr_sort[5][male],$arr_sort[1][male]
Different sizes doesn't matter, just mixing to whatever length of each one, (In short, we need to get a result so that if we remove the "male" array from the result we will get the original "female" array and vice versa. )