You can play with arguments to only fetch what you need and get rid of loop:
$classes = implode(' ', wp_get_post_tags( get_the_ID(), array('fields' => 'names') ) );
You can play with arguments to only fetch what you need and get rid of loop:
$classes = implode(' ', wp_get_post_tags( get_the_ID(), array('fields' => 'names') ) );