hi,

how to display an array of images using php.iam storing the images in array as follows.but how can i print these images.
$arr1=array('back_test.jpg','horses.jpg');
thanks
mrjameer

    foreach($arr1 as $imagename)
      {
      echo "<img src=\"$imagename\" />";
      }
    

      Hi there,

      You may try using regular "for" loop which works faster than "foreach" loop ... however in this scenario with an array of size 2 (2 images in the array), you might not see the difference:

      <?php
      
      //propage backwards
      
      for($i=sizeof($arr1) ; --$i<=0 ; )
      {
            echo '<img src="' . $arr1[$i] . '">';
      }
      
      ?>
        Write a Reply...