Get the users that my following users are following
You can use the implode function to concatenate array elements: $get_the_following_users = get_user_meta($current_user->ID, ‘following_users’, true); $meta_qssuery = ”; //initialise to an empty string foreach ( $get_the_following_users as $following_user ) { $following_user = get_user_meta($following_user, ‘following_users’, true); if(!empty($following_user)) { //check if any data was returned $meta_qssuery .= implode(‘, ‘, $following_user).’, ‘; } } echo $meta_qssuery; This will … Read more