html - Use PHP to increment number for image ID -


so, have problem in have 67 (and counting) images named image01.jpg, image02.jpg way image67.jpg.

in html page, have code display image.

<article class="thumb">                         <a href="images/fulls/image01.jpg" class="image"><img src="images/thumbs/image01.jpg" alt="" /></a> </article> 

so, have 67 images. there way of incrementing image number using php? can copy , paste piece of code number of images have?

that's first part great have solution too. but, there way not have repeat code every image? possible use php define number of times want repeated?

so have snippet of code once , have repeat defined number of times add collection, have change repeat times?

many in advance help. means allot.

<?php     for($i=1; $i<=67; $i++) { ?> <article class="thumb">     <a href="images/fulls/image<?php         if($i<9)             echo "0".$i;         else             echo $i;     ?>.jpg" class="image"><img src="images/thumbs/image<?php         if($i<9)             echo "0".$i;         else             echo $i;     ?>.jpg" alt="" /></a> </article> <?php     } ?> 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -