swf files in a directory

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

swf files in a directory

Post 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
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post by miro_igov »

Read php.net first. readdir();
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post by m2babaey »

thanks
i was reading: http://www.w3schools.com/php/func_files ... letype.asp
what to do about swf files?
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post by miro_igov »

Crap, i told you - the right function for you is readdir(); in php.net is enough explanations for your task.
thewebdrivers
Forum Commoner
Posts: 41
Joined: Fri Aug 17, 2007 3:32 pm
Location: india
Contact:

Post by thewebdrivers »

yeah, use readdir() and then use the following to return extension

Code: Select all

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