Why is it whenever I use scandir() I receive periods at the beginning of the array?
Array ( [0] => . [1] => .. [2] => bar.php [3] =&
Those are the current (.) and parent (..) directories. They are present in all directories, and are used to refer to the directory itself and its direct parent.
.
..