scan_dir shows me the first two images as dots

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ShatterStar
Forum Newbie
Posts: 4
Joined: Sun Nov 22, 2015 9:19 am

scan_dir shows me the first two images as dots

Post 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?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: scan_dir shows me the first two images as dots

Post 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.
ShatterStar
Forum Newbie
Posts: 4
Joined: Sun Nov 22, 2015 9:19 am

Re: scan_dir shows me the first two images as dots

Post by ShatterStar »

Hi thanks for your reply
Post Reply