Check role of Username then echo something if administrator [closed]

@terminator answer might work but there’s no need to create an array and use array_intersect I think since you’re only looking for one role. This might be more comprehensible:

$current_user = wp_get_current_user();
$roles = (array) $current_user->roles;
if (in_array('administrator', $roles) { /* echo whatever */ }

Don’t forget to check that ‘administrator’ is acutally the role key you want.