Skip to content
Advertisement

Tag: rename

Unable to Rename the latest file in a folder with PHP

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

Advertisement