You are looking for the command scandir.
$path = '/tmp'; $files = scandir($path);
Following code will remove . and .. from the returned array from scandir:
.
..
scandir
$files = array_diff(scandir($path), array('.', '..'));
1.4m articles
1.4m replys
5 comments
56.9k users