$result=Array (0 => Array ( 'days' => 20131217 ) ,
1 => Array ( 'days' => 20131218 ) ,
2 => Array ( 'days' => 20131219 ) ,
3 => Array ( 'days' => 20131220 ) ,
4 => Array ( 'days' => 20131221 ) ,
5 => Array ( 'days' => 20131222 ) ,
6 => Array ( 'days' => 20131223 ) ,
);
foreach($result as $key=>$value){
$newarr[]=$value['days']; //放入一维数组newarr
};
print_r($newarr);
//Array ( [0] => 20131217 [1] => 20131218 [2] => 20131219 [3] => 20131220 [4] => 20131221 [5] => 20131222 [6] => 20131223 )
$days = array();
for($i=0;$i$arr = $result[$i];
echo $i." ";
echo $arr['days']."
";
$days[] = $arr['days'];
}
print_r($days);
$result=Array (
0 => Array ( 'days' => 20131217) ,
1 => Array ( 'days' => 20131218 ) ,
2 => Array ( 'days' => 20131219 ) ,
3 => Array ( 'days' => 20131220 ) ,
4 => Array ( 'days' => 20131221 ) ,
5 => Array ( 'days' => 20131222 ) ,
6 => Array ( 'days' => 20131223 ) ,
);
foreach ($result as $a){
foreach ($a as $b){
$c[]=$b;
}
}
print_r($c);
?>
function arrayChange($array){static $arr2=array();
foreach($array as $v){
if(is_array($v)){
arrayChange($v);
}else{
$arr2[]=$v;
}
}
$arr2=array_unique($arr2); //这条语句是去掉重复值的
return $arr2;
}
$arr=arrayChange($result);
var_dump($arr);
?>