I've created a query getting only some users with specific criteria. I store these users into an array. My problem is to get back from this array only specific values like ids.
I print_r
my function myfriends()
and I get something like this:
Array (
[0] => Array (
[0] => Array (
[0] => WP_User Object (
[data] => stdClass Object (
[ID] => 48
)
)
[1] => WP_User Object (
[data] => stdClass Object (
[ID] => 47
)
)
)
[1] =>
)
)
I need to retrieve all the ids of users in array so I've tried with:
$myfriends = myfriends($user_id); //good
$myfriendsids = $myfriends->ID; //not working
$myfriendsids = $myfriends[0]->ID; //not working
$myfriendsids = $myfriends[0][0]->ID; //not working
$myfriendsids = $myfriends[0][0][0]->ID; //only the first user id!
//even tried
$myuserdata = $myfriends->data; //not working
$myuserids = $myuserdata->ID; //not working
How can I get all the user ids I have?
NB. "not working" means that I print_r
all the variables and I get nothing.
Thanks!