i tried to make the subject as simple and to the point as possible. heres my deal...
i have a chunk of code that reads a folder...
$dir = dir("$dir_games");
while ($file = $dir->read()) {
if (!is_dir("$file") && ($file != ".htaccess")) {
$filelist[] = $file;
}
for one, the part about !isdir doesnt work, if i have a dir in the current dir, it still shows up in the list. but it works for the . and .. so im not sure whats wrong there but thats not my issue im trying to fix.
what im looking to be able to do is (and it will actually fix my other problem by default) is to make the dir read only list items with a .swf extension. so a data file wont show up in the list. im not sure the best way to go about doing that.
i saw on my searches how to create a function to use $case and separate the files based on extension, but im basically reading the files i need into a $variable[$count] with $count ++ on each file to add to the list, but i only want it to read the .swf files, not anything else in the folder.
if its easy enough, i could use a small command to add in or if its something that requires some retooling of my code, any links to a resource would help a lot.
thanks