I'm trying to use a variable with the rename() function to rename a file at the end of a function.
I'm creating the new file name like so;
$filenamegen = "XML_MERGE_" . date("d:h:i:s");
rename ("F:\\a\\a\\a\\bb/tempname.xml", "F:\\a\\a\\a\\bb/" . $filenamegen . ".xml");
The filename, directory name, or volume label syntax is incorrect. (code: 123)
Change the first code line to:
$filenamegen = "XML_MERGE_" . date("d_h_i_s");
You cannot use ":" in a file name on Windows!