For example,
I have an empty directory named "subdirectory" path of which is as following:
Path:
/home/user/public_html/directory/subdirectory/
How shall I get or define "subdirectory" as a variable as I shall be renaming it with a database value in the following example.
$existing = "subdirectory"; // This is what I want capture from the above path and define as a variable
$new = "database_value";
$renamed = rename($existing, $new);