function move_file($fileFolder, $newPath, $reNameflag = false)
{
$temp = @scandir($fileFolder);
foreach ($temp as $v) {
$a = $fileFolder . '/' . $v;
if (is_dir($a)) {
if ($v == '.' || $v == '..') {
continue;
}
echo "<font color='red'>$a</font>", "<br/>";
move_file($a, $newPath, $reNameflag);
} else {
$newName = $v;
if ($reNameflag) {
$newName = uniqid() . '.' . explode('.', $v)[1];
}
echo "已完成--",$newPath . '/' . $newName, "<br/>";
copy($a, $newPath . '/' . $newName);
}
}
}
move_file('E:\phpStudy\PHPTutorial\WWW\climb\img\4kmeinv', 'E:/phpStudy/PHPTutorial/WWW/climb/one', true);