Re: array_unique by id multi-dimensional array

From: Date: Fri, 28 Oct 2011 02:40:47 +0000
Subject: Re: array_unique by id multi-dimensional array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-315477@lists.php.net to get a copy of this message
On Thu, Oct 27, 2011 at 10:31 AM, Tontonq Tontonq <rootdot@gmail.com> wrote: > i have an array like > >  [0] => Array > ( > [likes] => 113091 >  [name] => blabla >  [access_token] => AAABZCTx > [id] => 188206217874932 > > ) > >  [1] => Array > ( > [likes] => 113091 > [name] => blabla > [access_token] =>   AAABZCTz > [id] => 188206217874932 >   ) > > i want to filter the array by [id] sub value? > Not quite sure what you mean by "filter" in this case, but the function that pops to mind is http://www.php.net/manual/en/function.array-filter.php, which applies a callback function to each member of the array where you can determine if it should be included in the filtered list by returning true.

« previous php.general (#315477) next »