i want to copy all the files [but none of the folders] from one folder to another.
To copy only the files and not the folders this should work:
but i get the following error for every file that should be transfered
Warning: copy(/home/abc/dep/*"misc_filename".php): failed to open stream: No such file or directory in /var/ on line 101
line 101 :
any quick solutions??
To copy only the files and not the folders this should work:
Code:
<?php
define('TARGETDIR', '/home/xxx/mainwebsite/new/'');
foreach (glob('/home/abc/dep/*') as $dep) {
if (is_file($dep)) # Exclude directories
copy($dep, TARGETDIR . basename($dep));
}
?>
but i get the following error for every file that should be transfered
Warning: copy(/home/abc/dep/*"misc_filename".php): failed to open stream: No such file or directory in /var/ on line 101
line 101 :
Code:
copy($dep, TARGETDIR . basename($dep));
any quick solutions??