Possible Duplicate:
Best way to get files from a dir filtered by certain extension in php
I would like to create an array of the filenames of all .txt files in my directory.
Directory contents: - file1.txt - file2.txt - otherfile.php
Example array: - files[1]file1.txt - files[2]file2.txt