There are two entries present in every directory listing:
.
refers to the current directory
..
refers to the parent directory (or the root, if the current directory is the root)
You can remove them from the results by filtering them out of the results of scandir:
$allFiles = scandir(__DIR__); // Or any other directory
$files = array_diff($allFiles, array('.', '..'));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…