将数组某键值抽出作为新数组

<?php
$arr=array(array('id'=>'1','name'=>'lily','start'=>'20110101','end'=>'20110103'),
array('id'=>'2','name'=>'may','start'=>'20110101','end'=>'20110105'));


$new=array();
foreach($arr as $a){
$new[].=$a['id'];
}
print_r($new);
?>

 

posted @ 2012-10-15 17:35  tinyphp  Views(579)  Comments(0Edit  收藏  举报