|
Posted by fabrice rιgnier on 02/15/07 15:38
ok, instead of
if($res['age']!=0) $filtered[] = $item;
i put
if($item['age']!=0) $filtered[] = $item;
and it rocks ;)
thanx,
f.
fabrice rΓ©gnier wrote:
> hi ;)
>
>> Either by a loop:
>> $filtered = array()
>> foreach ($res as $key => $item){
>> if($res['age']!=0) $filtered[] = $item;
>> //or preserve keys by $filtered[$key] = $item;
>> }
>>
>> Or indeed by array_filter:
>> $filtered = array_filter($res,create_funtion('$v,$k','return
>> $v['age']!=0;'));
>
> I've tested your 2 solutions and both doesn't work.
>
> First solution gives me an empty array as a result.
> Second solution gives me a syntaxic error.
>
> Maybe you forgot something ? Thanx, anyway.
>
> f.
>
Navigation:
[Reply to this message]
|