I have this PHP code that works:
for ($i=0; $i < 5; $i++) {
    do stuff to $class
    echo "<i class=\"glyphicon glyphicon-star $class\"></i>";
}
Instead of using echo in the loop, how would I append each iteration to a variable (say $stars) and then be able to display the result with
echo "$stars";
 
     
     
    