I am quite new to php and wordpress developement, and I am also new to this website. I want to learn development by trial and error. Please forgive me if i don't use all proper terminology.
I have some code that gets the following id's for a user in buddypress. I would like to use these values in a loop and check the member types of the buddypress user.
I have 3 member types, and the end result should output an array of user ID's per member type.
Below code fetches the user ID's for members being followed by current user.
$following = bp_get_following_ids( $user_id) ;
print_r (explode(" ",$following));
Above code gives an output like e.g. : Array (  => 2,3,4,5,6,8,14 ) I would like to use this array in a user query
$user_query = new WP_User_Query( array( 'include' => array( 1, 2, 3 ) ) );
where 1,2,3 should be the output of the code above.
I have tried below, but that seems to be wrong.
$user_query = WP_User_Query( array( 'include' => explode(",",$following)));
How can i get the array into the query so i can create a loop to check the users by member type and output the ID's ? Thanks!