razad Posted September 30, 2008 Share Posted September 30, 2008 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 Link to comment https://forums.phpfreaks.com/topic/126375-list-file-with-specific-extension-from-sub-directories-and-copy/ Share on other sites More sharing options...
AndyB Posted September 30, 2008 Share Posted September 30, 2008 glob() is likely to help - http://ca.php.net/manual/en/function.glob.php Link to comment https://forums.phpfreaks.com/topic/126375-list-file-with-specific-extension-from-sub-directories-and-copy/#findComment-653514 Share on other sites More sharing options...
razad Posted September 30, 2008 Author Share Posted September 30, 2008 thanks, I will give it a try tomorrow and see if I can get it working. Thanks. Link to comment https://forums.phpfreaks.com/topic/126375-list-file-with-specific-extension-from-sub-directories-and-copy/#findComment-653516 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.