lundi 26 septembre 2016

How to loop an image to represent a number

i was able to display repuations in a tab but i want an image to represent the reputation number.

  <i class="fa fa-star-half-o"></i>   </a></li>

For instance if the reputation is 5 i want an image to repeat 5 times, if the reputation is 1 i want the image to repeat once and so on.

the image is located in my 'assets/images' folder i tired doing something like this below

   <?php 
     $j = artists->reputations;
     @for($j=1;$j<=5;$j++)
     <i class="fa fa-star-half-o"></i>  <img src="assets/images/star.png" style="height:60px;"></a></li>

    ;?>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire