Home >Backend Development >PHP Tutorial >Code to find the maximum and minimum value of a PHP array_PHP Tutorial

Code to find the maximum and minimum value of a PHP array_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:23:33980browse

Copy 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);
?>

Display 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: :Common 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
)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/324468.htmlTechArticleCopy the code as follows: ?php $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...
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