How to get user meta value in wordpress

You can store the user meta in a variable and check if the variable is empty or not, like below-

$args = array(
    'role' => 'subscriber',
    'meta_key' => 'user_designation'
);

// The Query
$user_query = new WP_User_Query($args);
// User Loop
$u_meta_array = array();
if ( !empty($user_query->results) ) {
    foreach ( $user_query->results as $user ) {
        $u_meta = get_user_meta($user->ID, 'user_designation', true);
        if (!empty($u_meta)){
            $u_meta_array[] = $u_meta;
        }
    }
    $u_meta_array_unique = array_unique($u_meta_array);
    foreach ($u_meta_array_unique as $u ) {
        echo '<option>' . $u . '</option>';
    }
} else { ?>
    <option value="0">No Category Found</option>
<?php } ?>

Hope that thing is gonna work. Please let me know if it works or not.

tech