title: Adding css classes to html element dynamically in php
body: <p>I am trying to build an application which has many courses.Each course has some days(e.g. 14 days or for another course 20 days).And to keep track on this I have a step progress bar.Which look like this:<a href="https://i.stack.imgur.com/Mlvjq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mlvjq.png" alt="enter image description here"></a></p>
  
  <p>Now in this example 14 days which are big circles with a lock icon.small circles in between are test quiz.</p>
  
  <p>I am using laravel for this. I am fetching all this data from the database and producing this step progress bar like this:</p>
  
  <pre><code>     &lt;ul class="progressbar"&gt;
          @for($i=1;$i&lt; $totalDays-&gt;total_days*2;$i++)
            &lt;li class=""&gt;&lt;/li&gt;
          @endfor    
       &lt;/ul&gt;
  </code></pre>
  
  <p>Now I want to add the active class to the active day (on which day currently is).</p>
  
  <p>Like This:</p>
  
  <pre><code>&lt;li class="active"&gt;&lt;/li&gt;
  </code></pre>
  
  <p>How can I achieve this in PHP? </p>
  
  <p>Thank you.</p>