Roles code not working

Is there a way I can convert the array to a string or display the array visually in a different way?