So I have a folder with two images. What happens with the code on pastebin is that it goes through checks the directory, checks for files in the folder with the extension.jpg and then prints them out into a image tag. I understand the for loop is probably a no no in php and we should use for each, but I like this way better >_>.
Aside from that, this whole this works, it goes through gets the images. Problem?
It prints the first image twice and the second once.
So: $this->get_images_in_dir[0] results in 2 images (the image printed twice) where as $this->get_images_in_dir[1] results in one. why? It should only print it once. like:
$this->get_images_in_dir[0] results in image1.jpg
$this->get_images_in_dir[1] results in image2.jpg
instead of
image1.jpg, image1.jpg, img2.jpg
Ideas?