first commit
This commit is contained in:
parent
735274944f
commit
32f3e0c785
43 changed files with 10512 additions and 0 deletions
49
rename-files.php
Normal file
49
rename-files.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
|
||||
$items = scandir("/var/www/nextcloud/data/radio_admin/files/archive",1);
|
||||
|
||||
$itemIndex = 1;
|
||||
|
||||
foreach($items as $item) {
|
||||
|
||||
|
||||
|
||||
$itemLink = "/var/www/nextcloud/data/radio_admin/files/archive/$item";
|
||||
$itemPath = "/var/www/nextcloud/data/radio_admin/files/archive/$item";
|
||||
|
||||
if($item != "." AND $item != "..") {
|
||||
if (is_file($itemPath)) {
|
||||
|
||||
|
||||
$itemBeforeAt = preg_split("/[@]+/", $item)[0];
|
||||
$itemAfterAt = preg_split("/[@]+/", $item)[1];
|
||||
|
||||
if (str_contains($item, '.md')) {
|
||||
|
||||
if (str_contains($item, '-i@')) {
|
||||
|
||||
|
||||
|
||||
$itemNew = substr($itemBeforeAt, 0, strlen($itemBeforeAt)-2) . ".md";
|
||||
|
||||
echo "$item <br> $itemNew <br><br>";
|
||||
|
||||
|
||||
rename($item,$itemNew);
|
||||
|
||||
rename("/var/www/pl4tform.org/website/data/files/240710_2200_test@pl4tform.txt", "/var/www/pl4tform.org/website/data/files/240710_2200_test@pl4tformmm.txt");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}}
|
||||
|
||||
|
||||
$itemIndex = $itemIndex + 1;
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue