title: array_slice but for images php
body: <p>i have written this code</p>
  
  <pre><code>  &lt;?php
          $a = Meme::all();
          $b = count($a);
          for($i=$b;$i&lt;$b-3;$i--)  {
      ?&gt;      &lt;div class="col-sm-6"&gt;&lt;img class="lazy" data-src="&lt;?php echo $a[$i]-&gt;path; ?&gt;" /&gt; &lt;/div&gt;
      &lt;?php
      }?&gt; 
  </code></pre>
  
  <p>i want to output the last 3 memes(images) but this for loop doesn't work. So i found something that is called array_slice and i wanted to use it but everyone was using print_r but in this case i don't need it. So any suggestions? </p>