title: How can I set my for - loop to print images in the HTML - page
body: <p>I have two images in a folder and their record is in a database so I want to show the images on the page through a for loop. But the problem is that I have classes (left and right) for which I want to define a variable to show images separately, so how can I do. The only problem is with the <code>$val</code> variable.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="col-md-7 wthree-services-bottom-grids"&gt;
              &lt;?php for ($i = 0; $i &lt; 2; $i++){ $val = ''?&gt;
              &lt;div class="wthree-services-&lt;?php echo $val; ?&gt;"&gt;
                  &lt;img src="&lt;?php echo base_url(); ?&gt;uploads/frontend/about_us/&lt;?php echo $about_images[$i]-&gt;image; ?&gt;" alt=""&gt;
              &lt;/div&gt;
              &lt;?php  $val = 'right'; }?&gt;
  &lt;!--            &lt;div class="wthree-services-right"&gt;
                  &lt;img src="&lt;?php echo base_url(); ?&gt;uploads/frontend/about_us/&lt;?php echo $about_images[1]-&gt;image; ?&gt;" alt=""&gt;
              &lt;/div&gt;--&gt;
              &lt;div class="clearfix"&gt; &lt;/div&gt;
          &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>