need help with this.
function move_images($dir_source,$dir_target){
$files = glob($dir_source);
foreach($files as $file){
if(is_file($file))
copy($file,$dir_target.basename($file));
unlink($file);
}
return true;
}
move_images('temp/*','../images/');
I got this message:
Warning: Invalid argument supplied for foreach() in /home/scrapboo/public_html/inc/functions.php on line 75
Actually, it's working good when there's a files in "temp" directory. So, how to skip this when temp is empty?
Thanks