Page 1 of 1

swf files in a directory

Posted: Fri Aug 17, 2007 11:12 pm
by m2babaey
Hi
i want to look into the directory files/folder1 and detect swf files. how can i do that?
i did some googling but it was showing me upload files tutorials

Posted: Sat Aug 18, 2007 7:30 am
by miro_igov
Read php.net first. readdir();

Posted: Sat Aug 18, 2007 7:48 am
by m2babaey
thanks
i was reading: http://www.w3schools.com/php/func_files ... letype.asp
what to do about swf files?

Posted: Sat Aug 18, 2007 7:51 am
by miro_igov
Crap, i told you - the right function for you is readdir(); in php.net is enough explanations for your task.

Posted: Sat Aug 18, 2007 8:36 am
by thewebdrivers
yeah, use readdir() and then use the following to return extension

Code: Select all

$filename = \'filename.swf\';
$ext = strrchr($filename,\'.\');