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

Sorting Array Values in PHP(數組排序)

復制代碼 代碼如下:
$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:
復制代碼 代碼如下:
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:
復制代碼 代碼如下:
$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( ) 主站蜘蛛池模板: 亚久久伊人精品青青草原2020 | 亚洲乱色视频在线观看 | 米奇影视999 | 一二三四视频免费社区5 | 色婷婷粉嫩AV精品综合在线 | 国产美女视频一区二区二三区 | 国产精品久久久久激情影院 | 久草精品视频 | jyzzjyzzz视频国产在线观看 | 八妻子秋霞理在线播放 | 公粗挺进了我的密道在线播放贝壳 | 丰满人妻妇伦又伦精品APP国产 | 征服艳妇后宫春色 | 影音先锋av333资源网 | 黄网13区| 千禧金瓶梅 快播 | 伦理片天堂eeuss影院2o12 | 噼里啪啦免费观看视频大全 | 午夜一个人在线观看完整版 | 国产精品一区二区资源 | 草b是什么感觉 | 最近最新中文字幕MV高清在线 | 寂寞夜晚视频在线观看 | 成人天堂资源WWW在线 | 国产真实强被迫伦姧女在线观看 | 一个人的视频在线观看免费观看 | 国产成人教育视频在线观看 | 精品久久久久中文字幕日本 | 国产短视频精品区 | 国产午夜视频在永久在线观看 | 久久青草在线视频精品 | 日日久久狠狠8888偷偷色 | 哺乳溢出羽月希中文字幕 | 亚洲国产欧美日韩在线一区 | 达达兔欧美午夜国产亚洲 | 国产欧美在线亚洲一区刘亦菲 | gayxxxxgay呻吟受日本 | 国产老师开裆丝袜喷水漫画 | 最近中文字幕在线中文视频 | 国产精品一区二区三区四区五区 | 邻居的阿2中文字版电影 |