<?<span>php </span><span>/*</span><span> 排序方式::事实上只需要将要循环的数组进行N次循环,然后每次取最大的一个值</span><span>*/</span> <span>$array</span> = <span>array</span>(100,25,10,258,33,48,10,5,13,58,333,108,1.2,5,3,33,0.7);<span>//</span><span>3 1 2 | 1 2 | 1 |</span> <span>$array2</span> = <span>array</span><span>(); </span><span>for</span>(<span>$y</span>=1;<span>$y</span><=17;<span>$y</span>++<span>){ </span><span>$max</span> = 0<span>; </span><span>for</span>(<span>$i</span>=0;<span>$i</span><<span>count</span>(<span>$array</span>);<span>$i</span>++<span>){ </span><span>if</span>(<span>$array</span>[<span>$i</span>] > <span>$max</span><span>){ </span><span>$index</span> = <span>$i</span><span>; </span><span>$max</span> = <span>$array</span>[<span>$i</span><span>]; } } </span><span>unset</span>(<span>$array</span>[<span>$index</span><span>]); </span><span>sort</span>(<span>$array</span><span>); </span><span>array_push</span>(<span>$array2</span>,<span>$max</span><span>); } </span><span>print_r</span>(<span>$array2</span><span>); </span>?>