php - sort results of array count values into a new array -
I want to sort the result in a new array but without the most non-US $ (or the most duplicate) Number will be the first).
& lt ;? Php $ a = array (1,1,2,2,2,3,3,3,4,4,4, 4,4,5); Forex currency (array_count_values ($ a) $ Key as the key = & gt; $ value) {echo $ key '-'. $ Value. ' & Lt; Br> '; } // I'm hoping to get the most duplicate numbers FIRST (without the $ key) // so in that position: // $ newarray = array (4,3,2,1,5); ? & Gt;
$ a = array (1,1,2,2,2) , 2), 3,3,3,3,4,4,4,4,5); $ Totals = array_count_values ($ a); Arsport ($ yoga); Echo "& lt; east & gt;"; Print_r ($ sum);
output
array ([4] => 5 [3] => 4 [2] => 3 [1] ] = & Gt; 2 [5] = & gt; 1)
Comments
Post a Comment