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.
$array = array_diff(scandir($dir), ['..', '.']);
to add 'images':
$arrayWithPrefix = substr_replace($array, 'images/', 0, 0);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…