I want to rename the latest added file from a folder, but somehow my code isn’t working. Could please help! For example, if the latest file is “file_0202.json” And I want to Change it to “file.json” Here is my Code Answer It’s better if you use glob(). glob() returns the path and filename used. Then you have to sort by
Tag: file-rename
How to rename uploaded file before saving it into a directory?
Below is the code I used in order to upload files into a directory. It works fine. My main question is: move_uploaded_file() is the one that saves the uploaded file into the directory, and it is also my guess that move_uploaded_file() is the one that sets the name for it. How could I change the name of my file to