To rename a directory in PHP, we can use the rename()
function. Here's an example:
main.php206 chars9 lines
In this example, we pass the old directory path and the new directory path to the rename()
function. If the function returns true
, the directory was renamed successfully. If the function returns false
, an error occurred and the directory was not renamed.
gistlibby LogSnag