Is there a way to get all the filenames in a certain directory and put them into an array? without knowing how many files there are or their names?
There certainly is! Have a look at http://www.php.net/opendir it gives some good examples there 🙂
try this out for starters
<?php if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "$file<br />\n"; } } closedir($handle); } ?>