Home > php教程 > php手册 > 求PHP数组最大值,最小值的代码

求PHP数组最大值,最小值的代码

WBOY
Release: 2016-06-06 20:39:07
Original
1417 people have browsed it

求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::正则表达式::http://www.jb51.net/list/list_6_1.htm", "3::服务器常用软件::http://s.jb51.net");
print_r($fruits);
rsort($fruits,SORT_NUMERIC);
print_r($fruits);
?>

显示结果:

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::正则表达式::http://www.jb51.net/list/list_6_1.htm
[3] => 3::服务器常用软件::http://s.jb51.net
)
Array
(
[0] => 155::vbscript::http://www.jb51.net/list/list_114_1.htm
[1] => 3::服务器常用软件::http://s.jb51.net
[2] => 2::正则表达式::http://www.jb51.net/list/list_6_1.htm
[3] => 1::javascript::http://www.jb51.net/list/list_3_1.htm
)

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template