Append date to filename before copy in php
I am trying to append date to the file name before copying in PHP. $fileS = "file.csv"; $date = date('m-d-Y H:i:s A e'); $fileD = "file$date.csv"; I have even tried $fileD = "file"."date('m-d-Y H:i:s A e')".".csv"; Then I copy the files $Confirm = copy($fileS, $fileD); I know I should check if the file exists etc etc but for the sake of simplicity to ask the question I am using this :). I am assuming it's something to do with the copy function that doesn't read concatenated strings. I may be wrong here. Any help with this is great appreciated. EDIT: The colon seems to be the problem not the