Skip to content

Commit 962bc81

Browse files
committed
Update rename-extension.php
1 parent ffffea9 commit 962bc81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utility/php/rename-extension.php

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ function renameExtension($dir, $oldExtension, $newExtension) {
33
// Set the path to the directory containing the files to rename
44
// $dir = "/path/to/directory/";
55

6+
if (substr($dir, -1) !== '/'){
7+
$dir .= '/';
8+
}
9+
610
// Open the directory
711
if ($handle = opendir($dir)) {
812

0 commit comments

Comments
 (0)