Home > Article > Backend Development > php move folders and files
The code is as follows | Copy the code |
/** $from = rtrim(str_replace(' //','/',$from), '/');//In order to be compatible on Linux, we convert all / symbols into / because both symbols under windows are acceptable. /* $files: Array ( [0] => . [1] => .. [2] => a [3] => b [4] => ; c [5] => dir [6] => dir.php [7] => dir2 [8] => dir2.php [9] => function_file.php [10] => homework .php ) if(is_dir($subFrom)){ |
The code is as follows | Copy the code |
|
if(rename ($file,$rename)==TRUE){ | echo "Rename file successfully!";}else{ | echo "Rename file failed!";
rename("html/renameCache.txt","html/a/2.txt"); //Use the rename() function to rename the directory Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn Previous article:Basic operations of directories and files 1 (44)Next article:Basic operations of directories and files 1 (44) Related articlesSee more |