Re: Return a certain value from an array

2012-06-18 Thread stork
$path = '/UsersUser[follower_id=' . $logged_user_id . ']/id'; debug(Set::extract($path, $data)); -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questi

Re: Return a certain value from an array

2012-06-18 Thread JonStark
It worked like a charm, thanks a lot ! Le lundi 18 juin 2012 13:34:03 UTC+2, JonStark a écrit : > > Lets say this is my array : > > array( > (int) 0 => array( > 'UsersUser' => array( > 'id' => '38', > 'follower_id' => '1', >

Re: Return a certain value from an array

2012-06-18 Thread Steve Found
$records = Set::extract('/UsersUser[follower_id=' . $logged_user_id . ']', $data ); foreach( $records as $record ){ $id = $record['UsersUser']['id']; ... Do something with the ID ... } On 18/06/12 12:34, JonStark wrote: Lets say this is my array : array( (int) 0 => array(