Page 1 of 1

scan_dir shows me the first two images as dots

Posted: Sat Dec 12, 2015 4:15 am
by ShatterStar
Hi Guys,

I am new here and I'm learning PHP. I am uploading images via the website and then I am displaying them using the scan_dir function together with a while loop however the first two images are output as one dot and two dots then the images show up, why is this?

I am also trying to output 3 images per row with the use of Bootstrap, any ideas on how to properly do this?

Re: scan_dir shows me the first two images as dots

Posted: Sat Dec 12, 2015 7:34 am
by Celauran
scandir returns both files and directories. . is the current directory, .. is the parent directory. You can use is_dir as you iterate over your results to exclude these and other directories.

Re: scan_dir shows me the first two images as dots

Posted: Thu Dec 17, 2015 8:18 am
by ShatterStar
Hi thanks for your reply