[eluser]tim1965[/eluser]
Hello. I have a view that loads the contents of an image directory, with images held within a specific directory based on an id. I create the path to the directory and run a get_filename to give me all the files in the directory. I then pass these to my view with the attached array
Quote:
array(2) { ["filename"]=> array(2) { [0]=> string(16) "XnN75WCkyzR6.gif" [1]=> string(16) "y5JSvVG5qQFr.gif" } ["path"]=> string(29) "./system/pictures/3/pictures/" }
Quote:
As you can see "filename" contains two files and "path" contains the path to the directory the files are in.
When i create my foreach loop i use the follwoing in my view
<?php
foreach($filename as $k => $v): { ?>
<li><img src="<?php echo base_url().$path.$v; ?>"></li>
<?php } ?>
<?php endforeach; ?>
So it should be looping through each iteration of $filename and then i create an img src for each element in $filename. I use $path and append the filename to pull back and display the image.
So my problem is that it is only displaying the first image and non of the others. The values are correct in my array but it doesnt seem to be executing the loop.
Any help appreciated.