The code that calculates the maximum and minimum values of the PHP array. For more information, see.
Copy codeThe code is as follows:
$ Fruits = array ("155: vbscript: http://www.bitsCN.com/list/list_114_1.htm", "1: javascript: http://www.bitsCN.com/list/list_3_1.htm", "2: Regular expression: http://www.bitsCN.com/list/list_6_1.htm", "3 :: common Software: http://s.bitsCN.com ");
Print_r ($ fruits );
Rsort ($ fruits, SORT_NUMERIC );
Print_r ($ fruits );
?>
Display result:
Array
(
[0] => 155: vbscript: http://www.bitsCN.com/list/list_114_1.htm
[1] => 1: javascript: http://www.bitsCN.com/list/list_3_1.htm
[2] => 2: Regular expression: http://www.bitsCN.com/list/list_6_1.htm
[3] => 3: common software: http://s.bitsCN.com
)
Array
(
[0] => 155: vbscript: http://www.bitsCN.com/list/list_114_1.htm
[1] => 3: server commonly used software: http://s.bitsCN.com
[2] => 2: Regular expression: http://www.bitsCN.com/list/list_6_1.htm
[3] => 1: javascript: http://www.bitsCN.com/list/list_3_1.htm
)