先看一维数据排序的实例asort()函数和ksort()函数<?php
//asort()函数以数组的值升序为准
$mix = array(“Clalei”=>10,”Bill”=>50,”Aala”=>100);
asort($mix);
print_r($mix);
//ksort()函数以数组的关键字升序为准
$mix = array(“Clalei”=>100,”Bill”=>50,”Aala”=>10);
ksort($mix);
print_r($mix);
?>一维数据排序二sort()函数,可将数组按字母或是数字的升序(从低到高)来进行排序:<?php
$name = array(“Clalei”,”Bill”,”Aala”);
sort($name);
for($i=0;$i<3;$i++){
echo $name[$i];
}
echo “
”;
$pri...
详细说一下php数组的一些常用函数
array_keys 获取数组的键key
例:Array ( [186] => dlb20120615150628259 [201] => D_INST0-1651339828086 [163] => dlb20120611170651943 [184] => dlb20120615130645200 [185] => dlb20120615140607347 [180] => dlb20120615120629364 [182] => dlb20120615130657938 [183] => dlb20120615130619415 [202] => D_INST0-1651339980726 [187] => dlb20120615150616702 [200] => D_INST0-1651339828032 [181] => dlb20120615130625533 [204] => D_INST0-16513...