天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

Sorting Array Values in PHP(數(shù)組排序)

復(fù)制代碼 代碼如下:
$full_name = array();
$full_name["Roger"] = "Waters";
$full_name["Richard"] = "Wright";
$full_name["Nick"] = "Mason";
$full_name["David"] = "Gilmour";

To sort this array, you just use the assort( ) function. This involves nothing more complex than typing the word asort, followed by round brackets. In between the round brackets, type in the name of your Associative array:
復(fù)制代碼 代碼如下:
asort($full_name);

The letter "a" tells php that the array is an Associative one. (If you don't have the "a" before "sort", your key names will turn in to numbers!). The "a" also tells php to sort by the Value, and NOT by the key. In our script above, the surnames will be sorted. If you want to sort using the Key, then you can use ksort() instead.

If you have a Scalar array (numbers as Keys), then you leave the "a" off. Like this:
復(fù)制代碼 代碼如下:
$numbers = array( );
$numbers[]="2";
$numbers[]="8";
$numbers[]="10";
$numbers[]="6";
sort($numbers);
print $numbers[0] ;
print $numbers[1];
print $numbers[2] ;
print $numbers[3];

The numbers are then sorted from lowest to highest. If you want to sort in reverse order then you need the following:

rsort( ) 主站蜘蛛池模板: 中文在线观看 | 亚洲中文字幕国产综合 | 中文字幕亚洲欧美日韩2o19 | 国产日韩精品一区二区三区在线 | 国产人妻人伦精品59HHH | 国产精品JK白丝AV网站 | 做i爱视频30分钟免费 | 国产欧美一区二区三区久久 | 国产一区二区三区内射高清 | 狠狠人妻久久久久久综合九色 | 两个吃奶一个添下面视频 | 全黄h全肉短篇禁乱np | 日本精品久久久久中文字幕 | 亚洲国产精品久久人人爱 | 国产永久免费高清在线观看 | 国内精自品线一区91 | 欧美亚洲日韩国码在线观看 | 久久久久99精品成人片三人毛片 | 伊人久久综合成人亚洲 | 日日夜夜影院在线播放 | 欧美成人精品高清在线观看 | 亚洲精品乱码久久久久久直播 | free性中国hd护士高清 | 伊伊人成亚洲综合人网 | 久久机热视频免费 | 国产精品99久久久久久宅男AV | 成人小视频免费在线观看 | 国产Av男人的天堂精品良久 | 中国老太婆xxxxx | 精品少妇高潮蜜臀涩涩AV | 日韩人妻少妇一区二区三区 | 美女禁处受辱漫画 | 久久视热频国产这里只有精品23 | 欧美日韩免费播放一区二区 | 97在线免费观看视频 | 好姑娘BD高清在线观看免费 | 亚洲乱码日产精品BD在线下载 | 色婷婷五月综合久久中文字幕 | 综合精品欧美日韩国产在线 | 国产精品青青在线麻豆 | 日本全彩黄漫无遮挡 |