$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
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',
>
$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(