Jump to content

list file with specific extension from sub directories and copy


razad

Recommended Posts

Hi,

 

I an new to php and needed some help to get a project done.

 

Problem:

 

I have a directory that have bunch of sub-directories in them and these have additional directory in them e.g

 

Root Dir ->  Sub Dir    -> Dir inside sub dir              -> content inside sub-sub dir   

GRAFIX          A              50 dir from 0001 to 0050      bunch of file and 2 dir REVS and SPRT in each dir

                    B              50 dir from 0051 to 0100

                    C

 

now I want to copy the file with a specific extension from the sub-sub directory to a new folder, but I do not want to copy the file in the REVS or SPRT folder.

 

I want to do this for all the folders in all the sub dir .

 

I was able to do this by creating a batch file where by I just listed all the with the .xyz extension and excluded the REVS or the SPRT folder and that works great, but I want to know how can I do this in PHP.

 

Any help would be appreciated

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.