Created
January 14, 2020 02:14
-
-
Save andresdhn/516e8196a229798b243365f6007f5e7e to your computer and use it in GitHub Desktop.
Rename files within multiple folders
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
<?php | |
chdir("slides"); | |
$slides = explode("\n", shell_exec("ls")); | |
foreach ($slides as $slide) { | |
echo $slide; | |
if ($slide) { | |
chdir("$slide"); | |
shell_exec("mv $slide.html index.html"); | |
chdir(".."); | |
} | |
} | |
chdir(".."); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment