Array into variable
-
Hello,
I have some code
$following = bp_get_following_ids( $user_id) ; print_r (explode(" ",$following));
which outputs e.g. : Array ( [0] => 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?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Array into variable’ is closed to new replies.