To handle directories. I am new in php.
Moderator: General Moderators
To handle directories. I am new in php.
Please help me with this issue. I would like to copy whole not empty directory to a destination folder but I do not know whether is there any possible way to do it with one copy command. Could you advise what to do ? Should I all the files and directories read first ? There is a lot of file and directories and deep structure of directories under this director I need to copy. Thanks 
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
using [php_man]glob[/php_man]() or a combo of [php_man]opendir[/php_man]()/[php_man]readdir[/php_man]() will get you the file list, if any, in that directory.
using [php_man]copy[/php_man]() and a loop like [php_man]foreach[/php_man]() or [php_man]while[/php_man]() you can copy each file over to the new folder.
using [php_man]copy[/php_man]() and a loop like [php_man]foreach[/php_man]() or [php_man]while[/php_man]() you can copy each file over to the new folder.