PHP loop directory

$files = scandir('.');
foreach($files as $file) {
    // do stuff
}