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

求PHP数组最大值,最小值的代码,需要的朋友可以参考下。

复制代码 代码如下:


<?php
$fruits = array("155::vbscript::https://www.jb51.net/list/list_114_1.htm", "1::javascript::https://www.jb51.net/list/list_3_1.htm", "2::正则表达式::https://www.jb51.net/list/list_6_1.htm", "3::服务器常用软件::");
print_r($fruits);
rsort($fruits,SORT_NUMERIC);
print_r($fruits);
?>


显示结果:

Array
(
[0] => 155::vbscript::https://www.jb51.net/list/list_114_1.htm
[1] => 1::javascript::https://www.jb51.net/list/list_3_1.htm
[2] => 2::正则表达式::https://www.jb51.net/list/list_6_1.htm
[3] => 3::服务器常用软件::
)
Array
(
[0] => 155::vbscript::https://www.jb51.net/list/list_114_1.htm
[1] => 3::服务器常用软件::
[2] => 2::正则表达式::https://www.jb51.net/list/list_6_1.htm
[3] => 1::javascript::https://www.jb51.net/list/list_3_1.htm
)

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/e1a5a4fb28540f69b7f85f1bb7467ff4.html