Introduction: This is a detailed page for sorting one-dimensional arrays whose array values are integer. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 333689 'rolling = 'no'>
Related native PHP functions include sort
Sort ($ array, sort_numeric)
Function array_sort ($ array) {$ return = array (); $ NO = count ($ array); $ max_key = 0; For ($ I = 0; $ I <$ no; $ I ++) {$ TMP = 0; foreach ($ array as $ key => $ num) {if ($ num> $ TMP) {$ TMP = $ num; $ maxkey = $ key;} unset ($ array [$ maxkey]); $ return [] = $ TMP;} return $ return ;} $ Nums = array (10, 5, 2, 4, 7); $ A = array_max ($ Nums); print_r ($ );
More articles about how to sort one-dimensional arrays whose array values are integer
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/333689.html pageno: 10.