I’m making a CLI script that mass renames files, however I do not know how to get the extension of a file that I don’t know the extension of… Basically the CSV file I have is laid out like so:
"New filename", "oldfile",
"New filename", "oldfile"
No extension is given on the old file. How would I go about doing this? I would greatly appreciate the help.
pathinfo will return an array which includes that information. You’re specifically looking for the key ‘extension’.