Home  >  Article  >  Backend Development  >  PHP multidimensional array code to find the maximum and minimum value of a PHP array

PHP multidimensional array code to find the maximum and minimum value of a PHP array

WBOY
WBOYOriginal
2016-07-29 08:47:021686browse

Copy the code The code is as follows:


$fruits = array("155::vbscript::http://www.jb51.net/list/list_114_1.htm", "1: :javascript::http://www.jb51.net/list/list_3_1.htm", "2::regular expression::http://www.jb51.net/list/list_6_1.htm", "3: :Common server software::http://s.jb51.net");
print_r($fruits);
rsort($fruits,SORT_NUMERIC);
print_r($fruits);
?>


Show results :
Array
(
[0] => 155::vbscript::http://www.jb51.net/list/list_114_1.htm
[1] => 1::javascript::http:// www.jb51.net/list/list_3_1.htm
[2] => 2::Regular expression::http://www.jb51.net/list/list_6_1.htm
[3] => 3: :Commonly used server software::http://s.jb51.net
)
Array
(
[0] => 155::vbscript::http://www.jb51.net/list/list_114_1.htm
[1] => 3::Common server software::http://s.jb51.net
[2] => 2::Regular expression::http://www.jb51.net/list/ list_6_1.htm
[3] => 1::javascript::http://www.jb51.net/list/list_3_1.htm
)

The above introduces the code for finding the maximum and minimum values ​​of PHP multi-dimensional arrays, including the content of PHP multi-dimensional arrays. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn