|
Posted by Chris Jones on 10/16/07 14:55
On 16 Oct, 14:46, TonyV <kingskip...@gmail.com> wrote:
> On Oct 16, 9:41 am, TonyV <kingskip...@gmail.com> wrote:
>
> > In perl, this would be a relatively simple task:
>
> > # --------------------------------------------------------------------
> > $arr_id = map { $_->{id} } @arr;
> > $arr_name = map { $_->{name} } @arr;
> > # --------------------------------------------------------------------
>
> I meant @arr_id and @arr_name, of course... ;)
$arr_id = array();
$arr_name = array();
foreach ($arr as $k=>$v){
array_push($arr_id,$v["id"]);
array_push($arr_name,$v["name"]);
}
Navigation:
[Reply to this message]
|