$nameFolder1="nameFolder1";
$nameFolder2="nameFolder2";
$files=scandir("files/{$nameFolder1}/");
foreach($files as $var)
{
if($var!="."&&$var!="..")
{
if(file_exists("./files/{$nameFolder1}/{$var}"))
{echo "ok";}
if(!move_uploaded_file("./files/{$nameFolder1}/{$var}", "./files/{$nameFolder2}/{$var}"))
echo "./mail_files/{$nameFolder1}/{$var}"."<br>";
}
}
может пути надо как то по другому писать?