天天躁日日躁狠狠躁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( ) 主站蜘蛛池模板: 麻豆人妻无码性色AV | 好男人好资源在线观看 | 色久久久综合88一本道 | 麻豆AV无码蜜臀AV色哟 | 免费人成网站永久 | 好看的电影网站亚洲一区 | 亚州三级视频 | 国产在线视频一区二区不卡 | 18禁止看的免费污网站 | 国产精品视频人人做人人爽 | 日韩欧美中文字幕在线二视频 | 亚洲色欲色欲无码AV | yellow免费观看完整版直播 | 精品精品国产自在现拍 | 琪琪色原网20岁以下热热色原网站 | 亞洲人妻AV無碼在線視頻 | 嫩草www视频在线观看高清 | 乳巨揉みま痴汉电车中文字幕动漫 | 久久综合给合久久狠狠狠… | 男女爽爽无遮挡午夜视频在线观看 | 爱穿丝袜的麻麻3d漫画acg | 久久高清免费视频 | 涩涩爱涩涩片影院 | 《乳色吐息》无删减版在线观看 | 色琪琪无码成人AV视频 | 精品视频久久久久 | 精品久久久亚洲精品中文字幕 | 男女生爽爽爽视频免费观看 | 男人脱女人衣服吃奶视频 | 亚洲国产成人在线视频 | acg全彩无遮挡口工漫画网址 | 日本xxxx69动漫 | 国内精品久久久久影院男同志 | 午夜国产免费视频亚洲 | 亚洲综合中文 | 最近2019年日本中文免费字幕 | 久久精品电影网 | 影888午夜理论不卡 樱桃熟了A级毛片 | 午夜福到在线2019 | 一个人免费完整观看日本 | 他揉捏她两乳不停呻吟口述 |