天天躁日日躁狠狠躁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( ) 主站蜘蛛池模板: 亚洲色 图 | 国产成人无码视频一区二区三区 | 天天影视色欲 影视 | 狠狠撩色姣姣综合久久 | 日本69色视频在线观看 | xxxx美国老师1819 | 美女露出乳胸扒开尿口 | 亚洲人成网77777色在线播放 | 四虎影视永久无码精品 | 日日AV夜夜添久久奶无码 | 亚洲中文字幕国产综合 | 亚洲中字幕永久在线观看 | 午夜想想爱午夜剧场 | 亚洲精品国偷拍自产在线观看蜜臀 | 国产精品18久久久久网站 | 国产精品爆乳尤物99精品 | 伊人精品久久久大香线蕉99 | 成人久久欧美日韩一区二区三区 | 99久久久无码国产精精品 | 久久机热视频 这里只有精品首页 | 美女拉开腿让男生桶到爽 | 亚洲另类欧美综合在线 | 韩国伦理片2018在线播放免费观看 | 好男人好资源在线观看免费视频 | 亚洲熟妇色自偷自拍另类 | 久青草国产在视频在线观看 | 亚洲色综合狠狠综合区 | 麻豆传煤网站网址入口在线下载 | 打卡中国各地奋斗第一线 | 国产视频成人 | 2019天天射干网站 | 亚洲黄色在线播放 | 色翁荡熄月月 | 最近中文字幕完整版免费高清 | 在线成年av动漫电影 | a级精品九九九大片免费看 A级韩国乱理伦片在线观看 | 久久久久久久久人体 | 国产亚洲精品久久孕妇呦呦你懂 | 高清 国产 在线 亚洲 | 国产精品九九九久久九九 | 亚洲欧洲日产国产 最新 |