This is my code:
$dir = "img/";
$files = scandir($dir);
for ($i=0; $i <= count($files); $i++) {
echo $files[$i]."<br/>";
}
echo count($files);
count of array returns value of 2 on empty array, I cheched for hidden files, zero resault. So what can cause this? var_dump resault
array(7) {
[0]=> string(1) "."
[1]=> string(2) ".."
[2]=> string(8) "img1.gif"
[3]=> string(8) "img2.gif"
[4]=> string(8) "img3.jpg"
[5]=> string(8) "img4.png"
[6]=> string(8) "img5.png"
}