復制代碼 代碼如下:
<?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
)