Last active
November 1, 2020 22:21
-
-
Save savasdersimcelik/a0de7bf8fbd7ebfa1e68bbc251b0a119 to your computer and use it in GitHub Desktop.
Bir kalsör ve içerisindeki tüm klasör ve doyaları başka bir noktaya kopyalama
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function recurse_copy($src,$dst) { | |
$dir = opendir($src); | |
@mkdir($dst); | |
while(false !== ( $file = readdir($dir)) ) { | |
if (( $file != '.' ) && ( $file != '..' )) { | |
if ( is_dir($src . '/' . $file) ) { | |
$this->recurse_copy($src . '/' . $file,$dst . '/' . $file); | |
} | |
else { | |
copy($src . '/' . $file,$dst . '/' . $file); | |
} | |
} | |
} | |
closedir($dir); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment