天天躁日日躁狠狠躁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( ) 主站蜘蛛池模板: 妓女嫖客叫床粗话对白 | 色悠久久久久综合网小说 | 久久视频这里只精品99re8久 | 亚瑟天堂久久一区二区影院 | 久久夜色噜噜噜亚洲AV0000 | jaPanesmature儿母| 男人和女人一起愁愁愁很痛 | 网友自拍偷拍 | 中文字幕专区高清在线观看 | 色姣姣狠狠撩综合网 | 嫩小幼处在线 | 一个人的视频全免费在线观看www | 久久精品国产亚洲AV麻豆欧美玲 | 美国色吧影院 | 久久这里只有精品2 | jk制服啪啪网站 | 亚洲高清免费在线观看 | 免费无码一区二区三区蜜桃大 | 快穿女主有名器的H纯肉黄暴拉文 | 国产亚洲精品精品精品 | 蜜桃狠狠色伊人亚洲综合网站 | 国产精品私人玩物在线观看 | 用快播看av的网站 | 涩涩视频在线看 | caoporn 免费视频 | 天天色天天干天天 | 欧美18精品久久久无码午夜福利 | 亚州三级视频 | 美女内射少妇一区二区四区 | 伊人大香线蕉影院在线播放 | 国产中文字幕在线 | 日韩欧美一区二区三区在线 | 在线观看国产日韩 | 免费无码国产欧美久久18 | 国产免费播放一区二区三区 | 51无码人妻精品1国产 | 大香网伊人久久综合观看 | 热热久久超碰精品中文字幕 | 国产成人精品亚洲线观看 | 国产精品欧美久久久久天天影视 | 亚洲福利电影一区二区? |